I'm working on fixing issues with Selenium tests designed to test submitting a review in a number of categories on a website, and I'm running into a problem with the connection dropping while a request is being performed. The errors seem to be nondeterministic- they don't always occur, and happen before the set timeout for a given action. I'm running the Selenium hub on a CentOS virtual machine (on my local machine), which seems to make network issues unlikely, since the webserver is running locally on my machine as well. I'm running into two main exceptions: "Error communicating with the remote browser. It may have died.", and CLIENT_GONE. I've included a sample of each of them below. If I run the tests 50 times, they might fail on anywhere from 10-30% of the time, while the rest of the time they run without an issue. Is there something I'm missing relating to the virtualbox connection, or how I could be using Selenium? Thanks in advance.
Stack trace for the UnreachableBrowserException:
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.5.0-49-generic', java.version: '1.7.0_60'
Driver info: driver.version: CoreDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
at org.openqa.selenium.remote.RemoteWebDriver.getPageSource(RemoteWebDriver.java:414)
at org.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:280)
at org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB$$58bad765.getPageSource(<generated>)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:537)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:513)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:497)
at com.foo.selenium.CoreDriver.waitForElementToAppearInElementByLocator(CoreDriver.java:378)
at com.foo.selenium.CoreDriver.waitForElementToAppearInElementByLocator(CoreDriver.java:343)
at com.foo.bar.reviewtest.ResponseTest.verifyResponse(ResponseTest.java:121)
at com.foo.bar.reviewtest.ResponseTest.runATest(ResponseTest.java:48)
at com.foo.bar.reviewtest.UserTestBase.testDriver(UserTestBase.java:129)
Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 1207803; received: 0
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:184)
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:204)
at org.apache.http.impl.io.ContentLengthInputStream.close(ContentLengthInputStream.java:108)
at org.apache.http.conn.BasicManagedEntity.streamClosed(BasicManagedEntity.java:157)
at org.apache.http.conn.EofSensorInputStream.checkClose(EofSensorInputStream.java:237)
at org.apache.http.conn.EofSensorInputStream.close(EofSensorInputStream.java:186)
at org.apache.http.util.EntityUtils.consume(EntityUtils.java:85)
at org.openqa.selenium.remote.HttpCommandExecutor$EntityWithEncoding.<init>(HttpCommandExecutor.java:412)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:300)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 39 more
... Removed 27 stack frames
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.5.0-49-generic', java.version: '1.7.0_60'
Driver info: driver.version: CoreDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
at org.openqa.selenium.remote.RemoteWebDriver.getPageSource(RemoteWebDriver.java:414)
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.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:280)
at org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB$$58bad765.getPageSource(<generated>)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:537)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:513)
at com.foo.selenium.CoreDriver.captureScreenAndSource(CoreDriver.java:497)
at com.foo.selenium.CoreDriver.waitForElementToAppearInElementByLocator(CoreDriver.java:378)
at com.foo.selenium.CoreDriver.waitForElementToAppearInElementByLocator(CoreDriver.java:343)
at com.foo.bar.reviewtest.ResponseTest.verifyResponse(ResponseTest.java:121)
at com.foo.bar.reviewtest.ResponseTest.runATest(ResponseTest.java:48)
at com.foo.bar.reviewtest.UserTestBase.testDriver(UserTestBase.java:129)
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:80)
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:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.TestNG.privateMain(TestNG.java:1338)
at org.testng.TestNG.main(TestNG.java:1307)
Caused by: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 1207803; received: 0
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:184)
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:204)
at org.apache.http.impl.io.ContentLengthInputStream.close(ContentLengthInputStream.java:108)
at org.apache.http.conn.BasicManagedEntity.streamClosed(BasicManagedEntity.java:157)
at org.apache.http.conn.EofSensorInputStream.checkClose(EofSensorInputStream.java:237)
at org.apache.http.conn.EofSensorInputStream.close(EofSensorInputStream.java:186)
at org.apache.http.util.EntityUtils.consume(EntityUtils.java:85)
at org.openqa.selenium.remote.HttpCommandExecutor$EntityWithEncoding.<init>(HttpCommandExecutor.java:412)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:300)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 39 more
And the second error:
org.openqa.selenium.WebDriverException: Session [fa85a873-517b-4054-8690-cccc02e17f41] was terminated due to CLIENT_GONE
Command duration or timeout: 2.56 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.5.0-49-generic', java.version: '1.7.0_60'
Session ID: fa85a873-517b-4054-8690-cccc02e17f41
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=LINUX, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false, javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false, webdriver.remote.sessionid=fa85a873-517b-4054-8690-cccc02e17f41, version=26.0.1410.63, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:307)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:348)
at org.openqa.selenium.By$ById.findElement(By.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:299)
at org.openqa.selenium.remote.Augmenter$CompoundHandler.intercept(Augmenter.java:280)
at org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB$$29d6fa2e.findElement(<generated>)
at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:523)
at org.openqa.selenium.support.ui.ExpectedConditions.access$0(ExpectedConditions.java:521)
at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:289)
at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
at com.tools.selenium.CoreDriver.waitForElementToBeInvisible(CoreDriver.java:300)
at com.tools.selenium.CoreDriver.waitForElementToBeInvisible(CoreDriver.java:288)
at com.foo.bar.reviewtest.ResponseTest.loginOnVisit(ResponseTest.java:55)
at com.foo.bar.reviewtest.ResponseTest.runATest(ResponseTest.java:44)
at com.foo.bar.reviewtest.UserTestBase.testDriver(UserTestBase.java:129)
Caused by: org.openqa.grid.common.exception.GridException: Session [fa85a873-517b-4054-8690-cccc02e17f41] was terminated due to CLIENT_GONE
at org.openqa.grid.internal.ActiveTestSessions.getExistingSession(ActiveTestSessions.java:104)
at org.openqa.grid.internal.Registry.getExistingSession(Registry.java:423)
at org.openqa.grid.web.servlet.handler.RequestHandler.getSession(RequestHandler.java:234)
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:116)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:722)
... Removed 30 stack frames
Did you get anywhere with this issue? I'm seeing the second issue (CLIENT_GONE) very regularly.
We run a suite of Selenium tests (about 200) overnight regularly, and for the past two nights have had hundreds of instances of this.
About 96% of the errors are from
get_PageSource
The vast majority are also taking over 25 minutes to produce this error, so it looks like it might be a timeout issue.
Related
The getDriver() function returns an instance of iOS Driver. I am getting the below error when trying to reset the app using the below command,
Driver.getDriver().resetApp();
I also tried replacing this command with closeApp and launchApp as below. But that is also failing with the same error.
Driver.getDriver().closeApp();
Driver.getDriver().launchApp();
The error is not very informative and I am not sure how to fix this error as well. Can someone please help me on the same please?
Unable to determine type from: Y. Last 1 characters read: Y
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Kishores-MBP', ip: 'fe80:0:0:0:35:43cd:351c:edd3%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_231'
Driver info: driver.version: IOSDriver
org.openqa.selenium.json.JsonException: Unable to determine type from: Y. Last 1 characters read: Y
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'Kishores-MBP', ip: 'fe80:0:0:0:35:43cd:351c:edd3%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_231'
Driver info: driver.version: IOSDriver
at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:122)
at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:140)
at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126)
at org.openqa.selenium.json.Json.toType(Json.java:69)
at org.openqa.selenium.json.Json.toType(Json.java:55)
at org.openqa.selenium.json.Json.toType(Json.java:50)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:87)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at io.appium.java_client.InteractsWithApps.resetApp(InteractsWithApps.java:93)
at hid.seos.testCases.ui.ListEventsForEndpoint.initialise(ListEventsForEndpoint.java:27)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:134)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:63)
at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:348)
at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:302)
at org.testng.internal.TestInvoker.runConfigMethods(TestInvoker.java:695)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:523)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:816)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.testng.TestRunner.privateRun(TestRunner.java:766)
at org.testng.TestRunner.run(TestRunner.java:587)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:28)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:425)
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Just figured out the root cause for the exception. It took me long enough, because the error message was not that much helpful.
Root Cause: I was using pcloudy for Appium, and I just missed the line for mentioning the platformVersion in pcloudyDesiredCapabilities. So if anyone else is facing the same issue, just make sure that you are not missing anything in the DesiredCapabilities part when you are initializing the Webdriver(AndroidDriver or IOSDriver).
today I had the same error when I was opening the URL (https://google.com) but after spending time trying to figured what was happen, I realized than the problem was triggered by the firewall where the selenium grid is hosted, so may the problem could be the access from the selenium grid the the URL what you want test. This is my poor experience and I hope help to you in your project.
I have written nearly 25 test case scripts. When I run the total scripts in Intellij idea, up to 12 scripts is working fine but while 13 script is running in middle of the session we are getting the error message like org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session.
Does anyone know a solution for this?
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=D:\esubcenter_mobile\eSubCenter_mobile\APK\eSubCenterQA-v1.1.12.9-debug(3).apk, noReset=true, platformVersion=6.0, platformName=Android, deviceName=192.168.59.101:5555}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'DIPL-CP-PC004', ip: '192.168.59.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumProtocolHandShake.lambda$1(AppiumProtocolHandShake.java:96)
at java.util.Optional.orElseThrow(Optional.java:290)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:96)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:112)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:73)
at org.init.DriverInitalize.setDrivercaps(DriverInitalize.java:38)
at org.init.TestBase.setDriver(TestBase.java:51)
at org.init.TestBase.beforeMethod(TestBase.java:91)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:599)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
Test ignored.
Test ignored.
Test ignored.
I'm not able to select any dropdown in firefox browser when using selenium 3 beta 2. I'm getting :
element not visible exception
Here are some more details:
StackError:
org.openqa.selenium.ElementNotVisibleException: Element is not visible (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: 'unknown', revision: '2aa21c1', time: '2016-08-02 14:59:43 -0700'
System info: host: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160817112116, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=48.0.1, platformVersion=10.0, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop}]
Session ID: 1bdaa5b9-a2b8-47aa-81b8-5516c39462a7
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:683)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:319)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
at org.openqa.selenium.support.ui.Select.setSelected(Select.java:324)
at org.openqa.selenium.support.ui.Select.selectByValue(Select.java:201)
at DriverTest.test(DriverTest.java:45)
While for chrome browser, it is perfectly working fine.
I think there is some issue with firefox browser. Currently i can see that firefox can be updated to 48.0.2. Do we have a fix for this yet?
You should use WebDriverWait if you are not using it.With WebDriverWait the code should be like
Select sel = new Select(new WebDriverWait(driver,30).until(ExpectedConditions.visibilityOfElementLocated(By.name("country"))));
sel.selectByVisibleText("Albania");
While running my test scripts in win7 IE11 using Selenium WebDriver I am getting below error:
Error:
==============================================================================================
Started InternetExplorerDriver server (64-bit)
2.42.0.0
Listening on port 13127
org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Software
caused connection abort: recv failed
org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 169 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'blr2261913', ip: '10.177.101.114', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_51'
Session ID: 71972154-3b97-4623-b651-aaa0bb460ffb
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=f
r=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true,
e, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 169 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'blr2261913', ip: '10.177.101.114', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_51'
Session ID: 71972154-3b97-4623-b651-aaa0bb460ffb
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=f
r=dismiss, version=11, ie.usePerProcessProxy=false, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, handlesAlerts=true,
e, browserAttachTimeout=0, ie.browserCommandLineSwitches=, takesScreenshot=true}]
at com.thoughtworks.selenium.webdriven.SeleneseCommand.apply(SeleneseCommand.java:44)
at com.thoughtworks.selenium.webdriven.Timer.run(Timer.java:40)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:143)
at com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:73)
at com.thoughtworks.selenium.DefaultSelenium.type(DefaultSelenium.java:317)
Env: Windows7-64 bit, IE11
IEDriver version: Latest i.e 2.42.0
Selenium Server: 2.41.0
I have already followed the steps mentioned https://code.google.com/p/selenium/wiki/InternetExplorerDriver ! NO LUCK!
Have searched enough over net but could not find any solution to my problem.
Any help will be highly appreciated.
Thanks in advance!
I'm not sure if this applies directly to your problem but I have come across something similar when I got the error:
Caused by: java.net.SocketException: Connection reset
Which lead me to a bug raised here: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7077696
You have recv failed in your error similar to this bug, however it was noted that it's more likely to be Windows Firewall causing the error rather than a bug. Some possible workarounds (from the site):
Run with -Djava.net.preferIPv4Stack=true
Add a firewall exception for the Java binary
Or disable stateful FTP inspection in the firewall
which I believe is done with: netsh advfirewall set global StatefulFTP disable
There is also an issue raised here: https://code.google.com/p/selenium/issues/detail?id=6437
Which applies to the error I have more so but it could possibly apply to yours? As comment #7 (from a project member) states there is a known issue with IE11.
This is may or may not help as I haven't had a chance to test the solutions and I'm not entirely sure of it myself!
I am working on selenium test automation. I have been recording test cases in Firefox and exporting the same as JUnit. I invoked the test cases with selenium web driver and run in different browsers. All test cases fail in IE6. But the same cases working fine in IE8 and 9. The issue is related to clicks. Clicks are not working in IE6, both by XPath and CSSpath.
I have tried the following code to invoke a click on same elements but it fails with error:
selenium.click("link=Advanced Search");
//selenium.click("xpath=//*[#id='simpleSearch']/a");
//selenium.click("css=div.cm>form#distributions>div#distributionsTab.bd>div#simpleSearch.mtm>a.mlm");
StackTrace:
com.thoughtworks.selenium.SeleniumException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_24'
Session ID: d90dd5dc-7800-4674-ba89-a159a820128b
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, cssSelectorsEnabled=true, handlesAlerts=true, browserName=internet explorer, nativeEvents=true, takesScreenshot=true, version=6}]
at org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:44)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:40)
at org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:138)
at org.openqa.selenium.WebDriverCommandProcessor.doCommand(WebDriverCommandProcessor.java:68)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:193)
at com.magicbox.testsuite.MagicBoxTestSuite.MotelTie6(MagicBoxTestSuite.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:21)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:29)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
at org.junit.rules.RunRules.evaluate(RunRules.java:19)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:232)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:223)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runners.Suite.runChild(Suite.java:129)
at org.junit.runners.Suite.runChild(Suite.java:24)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:232)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:61)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:223)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:684)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.openqa.selenium.WebDriverException: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_24'
Session ID: d90dd5dc-7800-4674-ba89-a159a820128b
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, cssSelectorsEnabled=true, handlesAlerts=true, browserName=internet explorer, nativeEvents=true, takesScreenshot=true, version=6}]
According do their website Internet Explorer Driver, they do.