question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Espresso WebdriverIO setImplicitTimeout not working

See original GitHub issue

I have Appium v1.16.0 , EspressoDriver (v1.18.0) , “webdriverio”: “^5.18.4”

Trying to add Implicit time out.

const driver = await wdio.remote(opts);
await driver.setImplicitTimeout(30000);
  
const logIn = await driver.$("//*[@text='LOG IN']");
await logIn.touchAction('tap');

on login button tap I am making API call and expected to see error field to be displayed.

await driver.setImplicitTimeout(40000);
const ErrorUserserNameField = await driver.$("~ErrorUserserNameField");
expect(await ErrorUserserNameField.isDisplayed()).toBe(true);

After tap next command to find ErrorUserserNameField is getting fire immediately and no such element error shown. Ideally it should wait until error label to be shown up on screen.

Logs:

"value":{"error":"no such element","message":"Could not find element with strategy ACCESSIBILITY_ID and selector ErrorUserserNameField","stacktrace":"io.appium.espressoserver.lib.handlers.exceptions.NoSuchElementException: Could not find element with strategy ACCESSIBILITY_ID and selector ErrorUserserNameField\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleInternal(Fin ....

I have tried in multiple devices and emulators but same error. Tried with UiAutomator2 working fine.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
KazuCocoacommented, Oct 4, 2022

I wonder if https://github.com/AppiumTestDistribution/appium-wait-plugin is good for the purpose.

The original intention in wait for element thing by set timeout in UIA2 was UIA framework by Google did not have any feature to wait an element present as the Espresso framework had. It is different from general wait for an element in Selenium’s client-side implementation like WebDriverWait in Python. The wait plugin does the behavior as appium server, so it seems like the plugin is the more proper one for your intention.

cc @saikrishna321 @SrinivasanTarget

0reactions
JuanCarlos-Arceredillocommented, Oct 4, 2022

Hi @KazuCocoa ,

Same here, I’m testing 2.10.0 with the same behavior. When the element exists the request finishes very quickly, but when it doesn’t exists, the request is frozen during around 30000 ms. Could it be possible to set another default value even using capabilities and allow developers to do a “wait and retry” system on our projects ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Espresso WebdriverIO setImplicitTimeout not working
I have Appium v1.16.0 , EspressoDriver (v1.18.0) , “webdriverio”: “^5.18.4” Trying to add Implicit time out. const driver = await ...
Read more >
Timeouts - WebdriverIO
A session has an associated session page load timeout that specifies a time to wait for the page loading to complete. Unless stated...
Read more >
setTimeout - WebdriverIO
It is not recommended to set implicit timeouts as they impact ... optional, Number, Time in milliseconds to wait for the document to...
Read more >
webdriverio/webdriverio - Gitter
so for android you use Espresso appium driver right ... yes I did, but it has some time, I'll take a look not...
Read more >
Use client.getElementAttribute in Appium With Examples
Run Appium automation tests on LambdaTest cloud grid ; wdio = require("webdriverio"); ; assert = require('chai').assert; ; 3 ; opts = { ;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found