Skip to content

Intermittent: KeepAliveFailure when running android test #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ren-bettendorf opened this issue Jan 11, 2018 · 8 comments
Closed

Intermittent: KeepAliveFailure when running android test #206

ren-bettendorf opened this issue Jan 11, 2018 · 8 comments

Comments

@ren-bettendorf
Copy link

Description

While running an Android test on a Windows machine with Appium 1.72 command line we are now seeing an issue where the test will cut off due to KeepAliveFailure when attempting to get a response from Appium.

Environment

  • .NET client build version or git revision if you use some shapshot:

  • Appium server version or git revision if you use some shapshot:
    1.72

  • Desktop OS/version used to run Appium if necessary:
    Windows 10

  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
    Node.js: 8.9.3
    Appium CLI

  • Mobile platform/version under test:
    Android

  • Real device or emulator/simulator:
    Emulator

Code To Reproduce Issue [ Good To Have ]

FindElement(string locator)
{
return FindElementById(locator);
}

// Basically we have a function that does a couple things like click around the screen and eventually gets to a portion where it will attempt to click a button twice and will not survive that.
FindElement(button).Click();
Thread.Sleep(TimeSpan.FromSeconds(10));
FindElement(button).Click();

Exception stacktraces

https://gist.github.com/renaldorini/24de85e6820e180bdff35097bf610090

Link to Appium logs

https://gist.github.com/renaldorini/b497423ebe2a014973df5fc619610622

@ren-bettendorf
Copy link
Author

Let me know how I can better help this since it is a pretty big issue that we just started seeing after switching to new 1.72.

@ren-bettendorf
Copy link
Author

Is anyone else seeing this or in the wrong place?

@Astro03
Copy link
Contributor

Astro03 commented Jan 18, 2018 via email

@ren-bettendorf
Copy link
Author

Yes this is using C#. I edited the test to avoid the issue, but still seeing it.

@sergmal
Copy link

sergmal commented Mar 5, 2018

Same happening to me. Not sure 100% if it is the same issue..

Using Appium.WebDriver 3.0.0.2, Appium 1.72, Real IOS device

OpenQA.Selenium.WebDriverException occurred
HResult=0x80131500
Message=A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://10.47.247.158:4723/wd/hub/session/75f7470d-ae02-47ec-90d6-c2aa001058f7/element. 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.
Source=appium-dotnet-driver
StackTrace:
at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.Support.UI.ExpectedConditions.<>c__DisplayClass13.<ElementIsVisible>b__12(IWebDriver driver) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func2 condition) at MobileUiAutomation.Pages.BasePage.IsReady() in C:\MobileUiAutomation\Pages\BasePage.cs:line 61 at MobileUiAutomation.Pages.BasePage..ctor(IOSDriver1 Driver) in C:\MobileUiAutomation\Pages\BasePage.cs:line 35
at MobileUiAutomation.Pages.AccountPage..ctor(IOSDriver`1 Driver) in C:\MobileUiAutomation\Pages\AccountPage.cs:line 25
at MobileUiAutomation.Tests.NewAccountTest.TestCreateNewAccount() in C:\MobileUiAutomation\Tests\NewAccountTest.cs:line 17

Inner Exception 1:
WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

Inner Exception 2:
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Inner Exception 3:
SocketException: An existing connection was forcibly closed by the remote host

@ren-bettendorf
Copy link
Author

Looks like this might be an issue with Selenium SeleniumHQ/selenium#5758

@manivannan184
Copy link

manivannan184 commented May 3, 2018

I am also facing same issue

03-May-18 14:16:39 PM : method name : Error : Choose Home screen - Exception: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://127.0.0.1:4723/wd/hub/session/2bf75e03-28e4-4c48-beab-6e8d96dec998/elements. 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. - Stack Trace: at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Appium.AppiumDriver1.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElements(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementsById(String id) at OpenQA.Selenium.Appium.AppiumDriver1.FindElementsById(String id)
at method.IsElementAvailable(device mDevice, String idNameOrtextName) in MyApp.cs:line 781

@laolubenson
Copy link
Collaborator

Please use the latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants