I have written a code which just opens an webpage and validates whether the page's title matches with the expected string or not.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class NewTest {
public String website = "https://opensource-demo.orangehrmlive.com/";
WebDriver driver = new ChromeDriver();
@Test
public void f() {
String actual = driver.getTitle();
String expected = "OrangeHRM";
Assert.assertEquals(actual, expected);
}
@BeforeTest
public void beforeTest() {
driver.get(website);
}
@AfterTest
public void afterTest() {
driver.close();
}
}
Now while running the code there is popup window stating an internal error { An internal error occurred during: "Launching NewTest". org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getClasspath(Lorg/eclipse/debug/core/ILaunchConfiguration;)Ljava/util/List; }