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

Locator method timing slowed ~200x creating scenarios to fail #16298

Closed
aquigriffin opened this issue Jan 4, 2022 · 8 comments
Closed

Locator method timing slowed ~200x creating scenarios to fail #16298

aquigriffin opened this issue Jan 4, 2022 · 8 comments
Labels
Needs Info typically non-actionable; needs author to respond

Comments

@aquigriffin
Copy link

The problem
While investigating an issue where our tests were running extremely slow, I discovered a prevalent issue where locator find methods by id, accessibility id, and xpath were slowed by ~200x the regular find times when the Android keyboard is on screen. Forcing the soft keyboard hidden via desired capabilities and/or hiding during the scenario did not improve times. I suspect this issue is the underlying issue for many other situations, e.g. keyboard typing slowness.
Environment
Appium Inspector - App Version: 2021.9.2, Electron: 13.5.0, Node.js: 14.16.0
Appium Server GUI - App Version: 1.22.0, Electron: 7.3.3, Node.js: 12.8.1
Android Emulator - Pixel 3 Android 11 (also replicable on Android 9 & 10)
Details
The following are screenshots of timings taken from the Appium Inspector to demonstrate the difference between emulator keyboard being displayed/hidden.

NOTE: Previous ticket #16269 was closed earlier due to "no response". Reopened the ticket due to issue still occurring. Furthermore in response to @mykola-mokhnach regarding this being a duplicate of #14594, this issue appears to be unique.

@mykola-mokhnach
Copy link
Collaborator

mykola-mokhnach commented Jan 4, 2022

Furthermore in response to @mykola-mokhnach regarding this being a duplicate of #14594, this issue appears to be unique.

  • Have you checked the logcat output to confirm it is unique? Do you observe idle wait delays there?
  • Have you also tried to set a custom idle timeout value?

@mykola-mokhnach mykola-mokhnach added the Needs Info typically non-actionable; needs author to respond label Jan 4, 2022
@aquigriffin
Copy link
Author

@mykola-mokhnach Hey thanks for the quick response. I'll double check the logcat output, but haven't tried the custom idle timeout value. I'm using Python and the link to issue #14594 appears to be the node.js version. I couldn't find the docs for the python version of waitForIdleTimeout... only this https://appium.io/docs/en/commands/session/timeouts/implicit-wait/
Can you point me to the correct docs?

@KazuCocoa
Copy link
Member

It is via settings api. > waitForIdleTimeout
https://github.com/appium/appium-uiautomator2-driver#settings-api

@aquigriffin
Copy link
Author

Oh I see. I found this was what I was looking for:

self.driver.update_settings({
        "waitForIdleTimeout": 3000,  # 3 seconds
})

Trying this out to see if this resolves our issues.

@aquigriffin
Copy link
Author

@KazuCocoa @mykola-mokhnach waitForIdleTimeout worked in cutting locator times down from ~20s to ~0.5s. Thanks for all your help.

@nageshc
Copy link

nageshc commented Aug 19, 2022

Hi @mykola-mokhnach and @aquigriffin

How to use in Webdriver IO
broswer.updateSettings( { "waitForIdleTimeout": 10000 } ) ;

Is this correct way to use in Webdriver iO Javascript

Thanks in Advance

@sudharsan-selvaraj
Copy link

Hi @mykola-mokhnach and @aquigriffin

How to use in Webdriver IO broswer.updateSettings( { "waitForIdleTimeout": 10000 } ) ;

Is this correct way to use in Webdriver iO Javascript

Thanks in Advance

You can refer to the webdriver.io documentation for updating the settings (https://webdriver.io/docs/api/appium/#updatesettings)

@nageshc
Copy link

nageshc commented Aug 19, 2022

Thank you @sudharsan-selvaraj for the quick response.

By doing like this it works for me.

const setting = { waitForIdleTimeout:100 };
await browser.updateSettings(setting);

Now it is executing fast.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Info typically non-actionable; needs author to respond
Projects
None yet
Development

No branches or pull requests

5 participants