FirefoxOptions chromeOptions = new FirefoxOptions();
WebDriver driver = null;
@BeforeTest
public void beforeTest() throws Exception
{
driver = new RemoteWebDriver(new URL("http://localhost:4444"), chromeOptions);
}
@Test
//Checking the title of iamNeo (Home - iamneo)
public void iamNeo() throws InterruptedException
{
// driver.manage().window().maximize();
driver.navigate().to("http://iamneo.ai/");
String title = driver.getTitle();
System.out.println(title);
Assert.assertEquals(title, "Learning and assessment solution for Universities and Enterprises");
}
@Test
//Moving to FACEBOOK
public void nextPage() throws InterruptedException
{
driver.navigate().to("https://www.facebook.com");
String title = driver.getTitle();
Assert.assertEquals(title, "Facebook – log in or sign up");
}
@Test
//Back to iamNeo
public void backPage() throws InterruptedException
{
driver.navigate().back();
String title = driver.getTitle();
System.out.println(title);
Assert.assertEquals(title, "Learning and assessment solution for Universities and Enterprises");
}
@Test
//Current URL
public void currentURL() throws InterruptedException
{
System.out.println(driver.getCurrentUrl());
String title = driver.getTitle();
System.out.println(title);
Assert.assertEquals(title, "Learning and assessment solution for Universities and Enterprises");
driver.navigate().forward();
driver.navigate().refresh();
}
@AfterTest
public void afterTest()
{
driver.quit();
}
:
It is Throwing Session Not created Exception :
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up :
org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'eeeccebaefcebfacecbccfaabacdfdabdafecefecf-0', ip: '10.41.17.6', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.217+', java.version: '11.0.13'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}}]
Capabilities {}
at ai.iamneo.testing.Testing_Selenium_TestNg.AppTest.beforeTest(AppTest.java:24)
Caused by: java.lang.RuntimeException: NettyHttpHandler request execution error
at ai.iamneo.testing.Testing_Selenium_TestNg.AppTest.beforeTest(AppTest.java:24)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException: Request timeout to localhost/127.0.0.1:4444 after 180000 ms
at ai.iamneo.testing.Testing_Selenium_TestNg.AppTest.beforeTest(AppTest.java:24)
Caused by: ja
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ai.iamneo.testing</groupId>
<artifactId>Testing-Selenium-TestNg</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Testing-Selenium-TestNg</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerVersion>11</compilerVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
It is mentioning BuildFailure while executing
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
Is There an issue with this 3.0.0-M5 Version of this plugin