Facing issue while execute automation using selenium

89 views
Skip to first unread message

Pooja Gosain

unread,
Dec 5, 2017, 11:08:15 PM12/5/17
to Selenium Users

Getting below error on command:-

WebDriverWait wait=new WebDriverWait(driver, 80);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//*[@id=‘status’]")));

Working fine on window 10 pro but not working on window 7 professional

Dec 04, 2017 1:24:35 PM org.openqa.selenium.support.ui.ExpectedConditions findElement
WARNING: WebDriverException thrown by findElement(By.xpath: //*[@id=‘status’])
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: ‘2.48.2’, revision: ‘41bccdd10cf2c0560f637404c2d96164b67d9d67’, time: '2015-10-09 13:08:06’
System info: host: ‘GURWUNI5F2086’, ip: ‘172.19.51.120’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: '1.8.0_131’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
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 org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:911)
at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:41)
at org.openqa.selenium.support.ui.ExpectedConditions$20.apply(ExpectedConditions.java:591)
at org.openqa.selenium.support.ui.ExpectedConditions$20.apply(ExpectedConditions.java:587)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:238)
at com.aricent.art.sanity.SelectDeviceTest.runTestRun(SelectDeviceTest.java:202)
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:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
at org.testng.TestNG.run(TestNG.java:1018)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:18445 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
Build info: version: ‘2.48.2’, revision: ‘41bccdd10cf2c0560f637404c2d96164b67d9d67’, time: '2015-10-09 13:08:06’
System info: host: ‘GURWUNI5F2086’, ip: ‘172.19.51.120’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: '1.8.0_131’
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
… 34 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:18445 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:143)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:89)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
… 35 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
… 48 more

murali krishna

unread,
Dec 6, 2017, 4:59:41 AM12/6/17
to Selenium Users
Follow below steps to reproduce your scenario :

  1. (a) Get the firefox profile name

    • try this command on run window firefox.exe -P or firefox.exe -P or firefox.exe -profilemanager

One of the above command will open pop up stating the name of Default profile which is nomaly "default"

  1. (b) Use below mentioned code for gettingthe firefox driver

    ProfilesIni allProfiles = new ProfilesIni();
    FirefoxProfile myProfile = allProfiles.getProfile("default");
    myProfile.setAcceptUntrustedCertificates(true);
    myProfile.setAssumeUntrustedCertificateIssuer(true);
    driver = new FirefoxDriver(myProfile);

Pooja Gosain

unread,
Dec 6, 2017, 5:51:19 AM12/6/17
to Selenium Users
I am using chrome browser not firefox.

Also  URL getting launch but when call this statement

wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//*[@id=‘status’]")));

failed the test case with “it may be died” but browser still opened in background.

Pooja Gosain

unread,
Dec 7, 2017, 4:38:17 AM12/7/17
to Selenium Users
Any update on this

⇜Krishnan Mahadevan⇝

unread,
Dec 7, 2017, 5:44:20 AM12/7/17
to Selenium Users
You are using a very old version of Selenium

Build info: version: ‘2.48.2’, revision: ‘41bccdd10cf2c0560f637404c2d96164b67d9d67’, time: '2015-10-09 13:08:06’

Can you please try again using the latest released version of Selenium (3.8.1).

Dont forget to fulfill the pre-requisites of geckodriver [ https://github.com/mozilla/geckodriver/blob/master/README.md#usage ]


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b021d854-e359-4f95-b5c0-c836bdf88da7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pooja Gosain

unread,
Dec 7, 2017, 11:31:26 PM12/7/17
to Selenium Users
I am also try with latest version of selenium but still facing the same issue
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Krishnan Mahadevan

unread,
Dec 7, 2017, 11:36:26 PM12/7/17
to seleniu...@googlegroups.com

Pooja,

 

>>>> I am also try with latest version of selenium but still facing the same issue

 

That doesn’t help add any context to the problem.

 

Here are a few things that you could help share:

 

  • Selenium version?
  • Browser flavor and version?
  • Server binary version? [ geckodriver/chromedriver/edgedriver/iedriverserver]
  • Stacktrace of the error
  • Sample test code that can be used to reproduce the problem against a public website.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

3.  ProfilesIni allProfiles = new ProfilesIni();
4.  FirefoxProfile myProfile = allProfiles.getProfile("default");
5.  myProfile.setAcceptUntrustedCertificates(true);
6.  myProfile.setAssumeUntrustedCertificateIssuer(true);
Reply all
Reply to author
Forward
0 new messages