Serenity: WebElementFacade doesn't detect the locator on mobile app - selenium

I was defining the locators for both platforms using WebElementFacade and calling the defined WebElementFacade into the method.
when running the scripts, the locator defined using WebElementFacade doesn't detect on the mobile app for both platforms. Below is the code example used:
Defining locators using WebElementFacade
#AndroidBy(id = "buttonRed")
#iOSFindBy(id = "LogInButton")
private WebElementFacade signInBtn;
Method using WebElementFacade
Assert.assertEquals(signInBtn.getText(), "SIGN IN");
System.out.println(signInBtn.getText());
So at the moment to make the code work, I'm using locators directly in the method. Below is the code example:
Method using without WebElementFacade
if (isPlatformIos()) {
Assert.assertEquals(find(By.id("LogInButton")).getText(), "SIGN IN");
System.out.println(find(By.id("LogInButton")).getText());
} else {
Assert.assertEquals(find(By.id("buttonRed")).getText(), "SIGN IN");
System.out.println(find(By.id("buttonRed")).getText());
}
build.gradle file:
buildscript {
repositories {
maven {
url 'https://repo.maven.apache.org/maven2'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.serenity-bdd:serenity-gradle-plugin:1.9.26'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.serenity-bdd.aggregator'
dependencies {
testCompile(
'net.serenity-bdd:serenity-junit:1.9.27',
'net.serenity-bdd:serenity-cucumber:1.9.12',
'org.assertj:assertj-core:3.10.0'
}
On running the scripts, I don't see any specific error message but only TimeoutException from the logs.
Error logs:
TEST FAILED WITH ERROR: Verify user is taken to Home screen
---------------------------------------------------------------------
11:08:05.393 [Test worker] DEBUG net.thucydides.core.steps.ConsoleLoggingListener - RELATED ISSUES:
11:08:05.532 [Test worker] ERROR net.thucydides.core.steps.ConsoleLoggingListener - TEST FAILED AT STEP Verify first onboarding screen
11:08:05.533 [Test worker] ERROR net.thucydides.core.steps.ConsoleLoggingListener - Expected condition failed: waiting for LoginScreen.welcomeScreenTitle to be displayed (tried for 5 second(s) with 100 milliseconds interval)Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'System info: host: 'Lappy78', ip: '102.18.120.471', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'Driver info: driver.version: unknownBuild info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'System info: host: 'Lappy78', ip: '102.18.120.471', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'Driver info: driver.version: unknown
com.company.qa.RunTests > Login.Verify user is taken to Home screen FAILED
org.openqa.selenium.NoSuchElementException
Caused by: org.openqa.selenium.TimeoutException
Expected condition failed: waiting for LoginScreen.welcomeScreenTitle to be displayed (tried for 5 second(s) with 100 milliseconds interval)
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: 'Lappy78', ip: '102.18.120.471', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
org.openqa.selenium.NoSuchElementException: Expected condition failed: waiting for LoginScreen.welcomeScreenTitle to be displayed (tried for 5 second(s) with 100 milliseconds interval)
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: 'Lappy78', ip: '102.18.120.471', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at net.serenitybdd.core.pages.WebElementFacadeImpl.throwNoSuchElementExceptionWithCauseIfPresent(WebElementFacadeImpl.java:888)
at net.serenitybdd.core.pages.WebElementFacadeImpl.checkPresenceOfWebElement(WebElementFacadeImpl.java:861)
at net.serenitybdd.core.pages.WebElementFacadeImpl.getText(WebElementFacadeImpl.java:952)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.thucydides.core.annotations.locators.AbstractSingleItemHandler.invoke(AbstractSingleItemHandler.java:45)
at com.sun.proxy.$Proxy28.getText(Unknown Source)
at com.company.qa.screens.LoginScreen.welcomeScreenTitle(LoginScreen.java:27)
at com.company.qa.steplib.LoginUser.verify_first_onboarding_screen(LoginUser.java:17)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7.CGLIB$verify_first_onboarding_screen$0(<generated>)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7$$FastClassByCGLIB$$8b3b74e.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:449)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:434)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:409)
at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:150)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:137)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:68)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7.verify_first_onboarding_screen(<generated>)
at com.company.qa.steps.LoginSteps.verify_onboarding_screen(LoginSteps.java:23)
at ✽.I am on first onboarding screen(src/test/resources/features/login.feature:7)
Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for LoginScreen.welcomeScreenTitle to be displayed (tried for 5 second(s) with 100 milliseconds interval)
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: 'Lappy78', ip: '102.18.120.471', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144'
Driver info: driver.version: unknown
at org.openqa.selenium.support.ui.FluentWait.timeoutException(FluentWait.java:303)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:271)
at net.serenitybdd.core.pages.WebElementFacadeImpl.checkPresenceOfWebElement(WebElementFacadeImpl.java:855)
at net.serenitybdd.core.pages.WebElementFacadeImpl.getText(WebElementFacadeImpl.java:952)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.thucydides.core.annotations.locators.AbstractSingleItemHandler.invoke(AbstractSingleItemHandler.java:45)
at com.sun.proxy.$Proxy28.getText(Unknown Source)
at com.company.qa.screens.LoginScreen.welcomeScreenTitle(LoginScreen.java:27)
at com.company.qa.steplib.LoginUser.verify_first_onboarding_screen(LoginUser.java:17)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7.CGLIB$verify_first_onboarding_screen$0(<generated>)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7$$FastClassByCGLIB$$8b3b74e.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:449)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:434)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:409)
at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:150)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:137)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:68)
at com.company.qa.steplib.LoginUser$$EnhancerByCGLIB$$722358e7.verify_first_onboarding_screen(<generated>)
at com.company.qa.steps.LoginSteps.verify_onboarding_screen(LoginSteps.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:31)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:25)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep(TestStep.java:102)
at cucumber.api.TestStep.run(TestStep.java:83)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:118)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:56)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:127)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
As using the locators directly in the method, the lines of code is been increased as I feel and to reduce the line of coding for both platforms using WebElementFacade is the best practice.
Could someone help me to find out what's causing the issue for not detecting the locator using WebElementFacade, please?
Thanks in advance
Vamc

It is working now like the below code is the example used.
#FindAll({
#FindBy(id = "buttonRed") //Android Identifier
#FindBy(id = "LogInButton") //IOS Identifier
)}
private WebElementFacade signInBtn;
As #AndroidFindBy or #iOSFindBy doesn't work with WebElementFacade so we need to use #FindBy for both platforms with different id's as above example.
Regards
vamc

Related

Timeout exception is showing after button click

After button click page get refresh and redirect to another page.In my case after button click i gave timeout for page refresh but after button click it showing timeout exception without time wait .i used all type of time wait event i used thread.sleep() but no use.
Exception :
FAILED: createEventTest
org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Command duration or timeout: 15.08 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'pc', ip: '192.168.1.6', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_79'
Session ID: a29803a6-5ec1-4791-b26f-3ab0adb47c7b
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=46.0.1}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:51)
at com.sun.proxy.$Proxy6.click(Unknown Source)
at com.pv.pages.CreateEventPage.createApprovedEvent(CreateEventPage.java:356)
at com.pv.pages.CreateEventPage.createEvent(CreateEventPage.java:688)
at com.pv.tests.CreateEventTests.createEventTest(CreateEventTests.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1246)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1171)
at org.testng.TestNG.run(TestNG.java:1066)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
Caused by: org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'pc', ip: '192.168.1.6', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.7.0_79'
Driver info: driver.version: unknown
at .Utils.installClickListener/e<(file:///C:/Users/fu/AppData/Local/Temp/anonymous7103862578695056607webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:9372)
at .WebLoadingListener/e(file:///C:/Users/fu/AppData/Local/Temp/anonymous7103862578695056607webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:5142)
at .WebLoadingListener/<(file:///C:/Users/fu/AppData/Local/Temp/anonymous7103862578695056607webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:5150)
at .fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Users/fu/AppData/Local/Temp/anonymous7103862578695056607webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:625)
Tried this?
driver.manage().timeouts().pageLoadTimeout(10,TimeUnit.SECONDS);
I used to javascript for page load .Now my code running fine.
public static void waitForPageToLoad() {
do {
js = (JavascriptExecutor) driver;
pageLoadStatus = (String)js.executeScript("return document.readyState");
System.out.print(".");
} while ( !pageLoadStatus.equals("complete") );
System.out.println();
System.out.println("Page Loaded.");
}

I am facing this exception org.openqa.selenium.remote.SessionNotFoundException: while using appium on android device

org.openqa.selenium.remote.SessionNotFoundException - this exception occurs when I try to debug my code, in between (may be because of delay) the app goes at the background and I start getting this exception. I am not sure if it is because of timeout and if yes, where to increase it in appium, as a capability to driver or at server level? I am putting the while trace here, any help will be appreciated.
2015-12-16 14:30:15,598 ERROR projects.sdk.lib.ObjectsHandler getElement -
Command duration or timeout: 8 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'VDO105-2.local', ip: '192.168.2.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.2', java.version: '1.7.0_75'
*** Element info: {Using=xpath, value=//android.widget.ImageView[#resource-id='android:id/home']}
Session ID: 4787f33a-c66e-46af-842b-3a41836b5d2c
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, app=/Users/user/Downloads/app-debug.apk, javascriptEnabled=true, browserName=Android, networkConnectionEnabled=true, desired={newCommandTimeout=30, app=/Users/user/Downloads/app-debug.apk, deviceName=Android, platformName=Android, serial=4d0025b440ca90d5}, locationContextEnabled=false, newCommandTimeout=30, platformVersion=5.0, databaseEnabled=false, deviceName=4d0025b440ca90d5, platformName=Android, webStorageEnabled=false, serial=4d0025b440ca90d5, warnings={}, takesScreenshot=true}]
org.openqa.selenium.remote.SessionNotFoundException:
Command duration or timeout: 8 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'VDO105-2.local', ip: '192.168.2.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.2', java.version: '1.7.0_75'
*** Element info: {Using=xpath, value=//android.widget.ImageView[#resource-id='android:id/home']}
Session ID: 4787f33a-c66e-46af-842b-3a41836b5d2c
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, app=/Users/user/Downloads/app-debug.apk, javascriptEnabled=true, browserName=Android, networkConnectionEnabled=true, desired={newCommandTimeout=30, app=/Users/user/Downloads/app-debug.apk, deviceName=Android, platformName=Android, serial=4d0025b440ca90d5}, locationContextEnabled=false, newCommandTimeout=30, platformVersion=5.0, databaseEnabled=false, deviceName=4d0025b440ca90d5, platformName=Android, webStorageEnabled=false, serial=4d0025b440ca90d5, warnings={}, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:164)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:490)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at projects.sdk.lib.ObjectsHandler.getElement(ObjectsHandler.java:84)
at projects.sdk.lib.ObjectsHandler.menuNavigation(ObjectsHandler.java:142)
at projects.sdk.lib.Actions.performAction(Actions.java:73)
at projects.sdk.lib.GetResults.getDeviceJsonResult(GetResults.java:170)
at projects.sdk.lib.GetResults.getResults(GetResults.java:76)
at projects.sdk.SDKAdServingTest.sdkTest(SDKAdServingTest.java:242)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
2015-12-16 14:30:20,262 ERROR projects.sdk.lib.ObjectsHandler getElement -
Command duration or timeout: 8 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'VDO105-2.local', ip: '192.168.2.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.2', java.version: '1.7.0_75'
*** Element info: {Using=xpath, value=//android.widget.TextView[#text='Banner']}
Session ID: 4787f33a-c66e-46af-842b-3a41836b5d2c
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, app=/Users/user/Downloads/app-debug.apk, javascriptEnabled=true, browserName=Android, networkConnectionEnabled=true, desired={newCommandTimeout=30, app=/Users/user/Downloads/app-debug.apk, deviceName=Android, platformName=Android, serial=4d0025b440ca90d5}, locationContextEnabled=false, newCommandTimeout=30, platformVersion=5.0, databaseEnabled=false, deviceName=4d0025b440ca90d5, platformName=Android, webStorageEnabled=false, serial=4d0025b440ca90d5, warnings={}, takesScreenshot=true}]
If appium does not receive any new command for 60 seconds it shuts down automatically.This might be the case when you are debugging your code.
You can verify if appium was shut down automatically by searching the below line in the appium logs:
info: [debug] We shut down because no new commands came in
After hit and try, I found this solution working: I added this capability to driver:
capabilities.setCapability("newCommandTimeout", timeout);

Issue with Selenium Webdriver: UnreachableBrowserException raised

I am trying to set up a continuous delivery pipeline and an UnreachableBrowserException is always raised.
Here is the full stacktrace:
17:20:05.970 ERROR - org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
17:20:05.977 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'ct-10-0-180-116', ip: '10.0.180.116', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab105.14', java.version: '1.8.0_51'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:125)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:58)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:175)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:202)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'ct-10-0-180-116', ip: '10.0.180.116', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab105.14', java.version: '1.8.0_51'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
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:422)
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
... 9 more
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'ct-10-0-180-116', ip: '10.0.180.116', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab105.14', java.version: '1.8.0_51'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:589)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
... 14 more
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'ct-10-0-180-116', ip: '10.0.180.116', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab105.14', java.version: '1.8.0_51'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:170)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:63)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
... 19 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:20882/status] to be available after 20010 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:167)
... 21 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 22 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
... 23 more
17:20:05.986 WARN - Exception: null
/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108
var template = new Error(this.message);
^
UnknownError: null
at new bot.Error (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108:18)
at Object.bot.response.checkResponse (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:109:9)
at /opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:160:24
at [object Object].promise.ControlFlow.runInFrame_ (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
at [object Object].goog.defineClass.notify (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
at [object Object].promise.Promise.notify_ (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
at Array.forEach (native)
at [object Object].promise.Promise.notifyAll_ (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
at goog.async.run.processWorkQueue (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:130:15)
at runMicrotasksCallback (node.js:337:7)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at [object Object].Builder.build (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)
at [object Object].DriverProvider.getNewDriver (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at [object Object].Runner.createBrowser (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/lib/runner.js:182:37)
at /opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/lib/runner.js:263:21
at _fulfilled (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /opt/local/nvm/versions/node/v0.12.0/lib/node_modules/protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
Here are the relevant parts from my bash script:
#Install protractor and webdriver & start webdriver
npm install -g protractor
webdriver-manager update
webdriver-manager start&
#Install and start application
./gradlew assemble
java -jar bignibou-server/build/libs/bignibou-server.jar&
#Run end2end tests
protractor bignibou-client/protractor.conf.js
Can someone please help?
edit 1: from protractor.conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['test/e2e/*.spec.e2e.js']
};
if (process.env.SNAP_CI) {
exports.config.chromeDriver = '/usr/local/bin/chromedriver';
}
edit 2: from my end2end test:
describe('Signin page', function () {
beforeEach(function(){
browser.get('http://localhost:8080/#/signin');
browser.refresh();
});
it('should allow user to signin', function () {
element(by.model('credentials.username')).sendKeys('balteo#example.fr');
element(by.model('credentials.password')).sendKeys('------');
element(by.id('submit')).click();
expect(element(by.tagName('h2')).getText()).toBe('Dashboard');
});
});

How to safely update chromedriver on selenium nodes

I have a selenium grid setup with one hub and 5 nodes. they both use the same version of selenium server 2.41.0.
On the nodes there are already chromedriver setup in the same folder as selenium sever.
Now the task is to update the chromedriver without broken any existing jenkins tests.
I have tried manually go to each nodes and update the chromedriver file. But, the tests on jenkins will throw WebDriverException saying unable to create driver.
What could be the issue here?
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
14:08:37.077 INFO - Executing: [new session: Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]] at URL: /session)
14:08:37.078 INFO - Creating a new session for Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]
Starting ChromeDriver (v2.10.267518) on port 13326
Only local connections are allowed.
[0.500][WARNING]: PAC support disabled because there is no system implementation
14:09:38.101 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:113)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:90)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:96)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:63)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:202)
at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:193)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:174)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:72)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:216)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
... 8 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:128)
... 13 more
14:09:38.103 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
the matter is that instance of driver is created on host machine (using existing chromdriver file there). Obviously once you substitute updated chrome driver file (of a newer version) older one -> everything should work fine after driver instance reinitizalization.
To initialize driver , I'm using following java piece of code:
public static WebDriver driverSetUp(WebDriver driver) throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.chrome();
log.info("Google chrome is selected");
System.setProperty("webdriver.chrome.driver", "....path/chromedriver.exe");
capability.setBrowserName("chrome");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
String webDriverURL = "http://" + environmentData.getHubIP() + ":" + environmentData.getHubPort() + "/wd/hub";
driver = new RemoteWebDriver(new URL(webDriverURL), capability);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().window().setSize(new Dimension(1920, 1080));
return driver;
}
Try it out and let us know whether issue persists. Thanks.

"Session XXXXXXX does not exists" is shown when executing selenium scripts remotely

I get the following errors:
2012-07-04 15:33:36,582 INFO root:68 -
at TestRunner.main(TestRunner.java:57)
at TestRunner.startTests(TestRunner.java:108)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:309)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:212)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:543)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Tc.tcCloseSelenium(Tc.java:112)
at Uc.closeSelenium(Uc.java:139)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:346)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:476)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:472)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.GeneratedConstructorAccessor85.newInstance(Unknown Source)
Session ID: 7a5fee88-98ec-441b-8412-b9fc9cf73b66
Driver info: driver.version: RemoteWebDriver
System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_01'
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 15:28:49'
Command duration or timeout: 0 milliseconds
org.openqa.selenium.WebDriverException: session 7a5fee88-98ec-441b-8412-b9fc9cf73b66 does not exist
2012-07-04 15:33:36,457 INFO root:58 - Tc.tcCloseSelenium
at TestRunner.main(TestRunner.java:57)
at TestRunner.startTests(TestRunner.java:108)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:309)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:212)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:543)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at Tc.tcCloseSelenium(Tc.java:112)
at Uc.closeSelenium(Uc.java:139)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:346)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:476)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:472)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.GeneratedConstructorAccessor85.newInstance(Unknown Source)
Session ID: 7a5fee88-98ec-441b-8412-b9fc9cf73b66
Driver info: driver.version: RemoteWebDriver
System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_01'
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 15:28:49'
Command duration or timeout: 0 milliseconds
org.openqa.selenium.WebDriverException: session 7a5fee88-98ec-441b-8412-b9fc9cf73b66 does not exist
This happens at the very beginning (most probably the seleniumDriver.get(ddt.gv.get("app_url")); command) of the script execution process remotely via some ASP.net webapplication. As a result all the Test&Use cases fail.
The webdriver is internetexplorerdriver:
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability("ignoreProtectedModeSettings" , true);
InternetExplorerDriver seleniumDriver = new InternetExplorerDriver(ieCapabilities);
seleniumDriver.get(ddt.gv.get("app_url"));
Are you trying to cleanup your test multiple times?
The thing is..
if you are doing driver.Close() or any type of cleanup multiple times, its gonna erase/close what you want to cleanup then those objects are not found and that is the error you get!
Hope it helps! Let me know!