appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.91k stars 6.08k forks source link

default implicit wait set for pageobject is not working #7887

Closed vikramvi closed 7 years ago

vikramvi commented 7 years ago

The problem

I've set implicit wait for a page as below

protected WebDriver driver;

public AUTLandingPage(WebDriver driver) {
        this.driver = driver;
        PageFactory.initElements(new AppiumFieldDecorator(driver, 10, TimeUnit.SECONDS), this);
    }

I also checked with AppiumDriver but same issue

In this pageobject class, I check for availability of element with method isEnabled()

particularElement.isEnabled()

But instead of waiting for 10 sec, driver just continues execution after 0 sec

Environment

Details

  1. Our app is built with Swift and has got multiple screens. Mainly app login and post login screens on which test cases are run.
  2. This happens when I login and goto next screen.
  3. Then this issue happens https://github.com/appium/appium/issues/7034
  4. After this I've observed appium doesn't wait for default implicit time mentioned in constructor

Link to Appium logs

https://gist.github.com/vikramvi/9814a6b6281634a64bb97f2d04ba6101

Code To Reproduce Issue [ Good To Have ]

Refer to code in https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app/blob/63a8b6f799d034fba39425b9a1f1fbe26eab6b91/src/test/java/Pages/BasePage.java

In my case; I start with app login page goto post login main screen and logout.

Issue is observed when I login and wait for an element to confirm that login is successful.

imurchie commented 7 years ago

Implicit wait only applies to finding elements. Once you have an element, checking an attribute on it just calls and returns.

vikramvi commented 7 years ago

@imurchie Please find some more update on this issue

  1. After trying out solution per https://github.com/appium/appium/issues/7034, I've observed that it's being applied for finding out elements ( I'm not checking attributes of element but just element to do some action on it )

  2. But found new issue https://github.com/appium/java-client/issues/574 can you please have a look and clarify if it's related to java client or server ?

Thanks again

imurchie commented 7 years ago

Doing any action on an element does not involve implicit wait. Any problem with waiting for that is a client-side issue.

TikhomirovSergey commented 7 years ago

@imurchie Please close this ticket

SrinivasanTarget commented 7 years ago

@triager please close

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.