SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

.NET android-server-2.32.0.apk connection and keep alive issues #5894

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 5894

I am using all the .NET bindings in selenium-dotnet-2.33.0.zip and was previously using
android-server-2.21.apk without any issues. I'm targeting a mobile device with Android
4.1.2. 

I have upgraded to android-server-2.32.0.apk and my tests now intermittently run into
connection issues, below is the exception details.

This exception occurs when tests even fail to launch the mobile browser:

OpenQA.Selenium.WebDriverException : A exception with a null response was thrown sending
an HTTP request to the remote WebDriver server for URL http://localhost:8080/wd/hub/session/5306df76-a0c7-4efb-9408-15bbd72ffaf6/execute.
The status of the exception was ConnectionClosed, and the message was: The underlying
connection was closed: The connection was closed unexpectedly.
  ----> System.Net.WebException : The underlying connection was closed: The connection
was closed unexpectedly.
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptInternal(String script, Boolean async, Object[] args)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[] args)
   at WebDriver_HotelsCombined.WebDriverCommonMethods.WaitForAjax(IWebDriver driver)
in WebDriverCommonMethods.cs: line 186
   at WebDriver_Mobile.AndroidMobileSiteFunctionality.MobileHomePage() in AndroidMobileSiteFunctionaility.cs:
line 35
--WebException
   at System.Net.HttpWebRequest.GetResponse()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)

And this exception occurs when tests are in progress:

OpenQA.Selenium.WebDriverException : A exception with a null response was thrown sending
an HTTP request to the remote WebDriver server for URL http://localhost:8080/wd/hub/session/6cce95e8-be94-4ca6-8993-56ec7360ef08/element/6/click.
The status of the exception was KeepAliveFailure, and the message was: The underlying
connection was closed: A connection that was expected to be kept alive was closed by
the server.
  ----> System.Net.WebException : The underlying connection was closed: A connection
that was expected to be kept alive was closed by the server.
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebElement.Click()
   at WebDriver_Mobile.AndroidMobileSiteFunctionality.MobileHomePage() in AndroidMobileSiteFunctionaility.cs:
line 55
--WebException
   at System.Net.HttpWebRequest.GetResponse()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)

Reported by chrisautomate on 2013-07-08 07:37:20

lukeis commented 8 years ago
Even I am facing the same issue. I am trying to run the test case on Chrome. Below is
the error details

OpenQA.Selenium.WebDriverException: A exception with a null response was thrown sending
an HTTP request to the remote WebDriver server for URL http://localhost:63538/session/3f72078618f7592ce704872d2c1759e0/element/:wdc:1374467456958/value.
The status of the exception was KeepAliveFailure, and the message was: The underlying
connection was closed: A connection that was expected to be kept alive was closed by
the server. ---> System.Net.WebException: The underlying connection was closed: A connection
that was expected to be kept alive was closed by the server.

Stack trace is : 

System.Net.HttpWebRequest.GetResponse()
OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2
parameters)
OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text)

Does anyone have solution for this?

Reported by ba.raghu on 2013-07-22 04:39:00

lukeis commented 8 years ago
I'm facing the same issue in Ruby with selenium-webdriver gem 2.32.1 talking to webdriver
running with android-server-2.32.0.apk seeing EOFError: End of file reached with Default
http client. And seeing HTTPClient::KeepAliveDisconnected: HTTPClient::KeepAliveDisconnected
using Remote http client which I created to debug the issue.

Reported by highlandwolf@yahoo.com on 2013-07-31 22:05:48

lukeis commented 8 years ago

Reported by barancev on 2013-08-08 22:35:28

lukeis commented 8 years ago
Selenium project no longer supports the AndroidDriver.

Please use Selendroid instead:
http://selendroid.io/webview.html

And log any issues against that project:
https://github.com/selendroid/selendroid/issues

Reported by luke.semerau on 2013-12-26 21:57:36

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:17:33