Skip to content
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

bug: Unable to timeout find_elements and webdriver.Remote #855

Open
1 task done
eyJhb opened this issue Apr 26, 2023 · 3 comments
Open
1 task done

bug: Unable to timeout find_elements and webdriver.Remote #855

eyJhb opened this issue Apr 26, 2023 · 3 comments
Labels

Comments

@eyJhb
Copy link
Contributor

eyJhb commented Apr 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Sometimes webdriver.Remote will hang, and it will timeout at any point.
The same goes for using find_elements, if WDA crashes/hangs, then it will never timeout.

I've tried setting appium:newCommandTimeout to 5, but it will still just hang forever.
The only thing I've found that worked, was sitting driver.command_executor.keep_alive = False and driver.command_executor.set_timeout(5).

It's quite unclear, what the best/correct way, is to set a timeout for "anything" so that it cannot just hang indefinitely.

Expected Behavior

That it would timeout after 5 seconds, and there would be a clear documented way of doing this.

Minimal Reproducible Example

from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy

ios_caps = {
    "appium:automationName": "XCUITest",
    "platformName": "iOS",
    "appium:udid": "00008020-001655400E82002E",
    "appium:webDriverAgentUrl": "http://localhost:7777",
    "appium:newCommandTimeout": 5,
}

driver = webdriver.Remote("http://127.0.0.1:4723", ios_caps)
driver.command_executor.set_timeout(5)
driver.find_elements(by=AppiumBy.IOS_PREDICATE, value="type LIKE '**'")

The find_elements in a slow app (ie. TikTok) will never return.

Environment

  • Operating system:
  • If running via appium CLI...
    • Appium CLI version (output of appium --version): 2.0.0-beta.58
    • Node.js version (output of node --version): v18.12.1
    • npm version (output of npm --version): 8.19.2
    • Last appium version which did not exhibit the problem: ?
  • If running Appium Desktop, its version:
  • Appium driver(s) and their version(s): - xcuitest@4.21.1 [installed (npm)]
  • Appium plugin(s) and their version(s): go-ios (gist attached later)
  • Platform and version under test: iOS 16.4.1
  • Real device or emulator/simulator: real device

Link to Appium Logs

No response

Futher Information

No response

@eyJhb eyJhb added the bug label Apr 26, 2023
@mykola-mokhnach mykola-mokhnach transferred this issue from appium/appium Apr 26, 2023
@eyJhb
Copy link
Contributor Author

eyJhb commented Apr 27, 2023

@mykola-mokhnach is there a way to do this for other clients?

@mykola-mokhnach
Copy link
Contributor

I don't know. xcuitest driver has the appium:commandTimeouts capability, which might be helpful in such situation

@eyJhb
Copy link
Contributor Author

eyJhb commented Apr 27, 2023

Based on the default value of that, it doesn't work. I've had tests hang for hours, and the default value specifies 120s.
Most of the time, the case is that the WDA server becomes unresponsive, and Appium will just hang forever waiting for a response.

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

No branches or pull requests

2 participants