I am using maven
to run my selenium test cases .I have taken the whole code to my digital ocean
Ubuntu
server ,I have installed or configured all necessary plugins like chromedriver
,maven
..etc .
On running the command mvn test
I am getting the following error .
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: TestNG652Configurator
Starting ChromeDriver 2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320) on port 28572
Only local connections are allowed.
May 19, 2017 4:56:16 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
May 19, 2017 4:57:17 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Configuring TestNG with: TestNG652Configurator
Tests run: 5, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 63.761 sec <<< FAILURE! - in TestSuite
invokeBrowser(datum.LoginTest) Time elapsed: 63.281 sec <<< FAILURE!
org.openqa.selenium.NoSuchSessionException: no such session
(Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.4.0-78-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 85 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'devopspipe', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-78-generic', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.4.0-78-generic x86_64), platform=ANY}]
Session ID: 7c4d43849026d2b42c83fa6d39230969
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:658)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:882)
at datum.UtilsMethods.browserInvoke(UtilsMethods.java:99)
at datum.LoginTest.invokeBrowser(LoginTest.java:20)
Results :
Failed tests:
LoginTest.invokeBrowser:20 ยป NoSuchSession no such session
(Driver info: chr...
Tests run: 5, Failures: 1, Errors: 0, Skipped: 3
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:10 min
[INFO] Finished at: 2017-05-19T04:57:18+00:00
[INFO] Final Memory: 20M/48M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project DataVisualisation: There are test failures.
[ERROR]
[ERROR] Please refer to /home/sample-selenium-datum/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
If there is any other way of running the test cases on cloud please suggest and if I need to provide any other information let me know . My browser invocation code :
else if(browserName.equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "/home/arima/chromeDriver/chromedriver");
//System.setProperty("webdriver.chrome.driver", "/home/selenium-drivers/chromedriver");
capability = DesiredCapabilities.chrome();
driver = new org.openqa.selenium.chrome.ChromeDriver(capability);
driver.manage().window().maximize();
driver.get(url);
}