althaf_tvm
althaf_tvm

Reputation: 773

Appium for Android with multiple Fragments

I am using Appium for automating my Android app. I have a fragment to enter email and after verifying that second fragment with passwordfield will be loaded. I am able to find all elements in the first fragment; but elements in the second fragment can't be found using any of the methods like By, PageFactory + @AndroidFindBy. Can someone provide a help to sort this issue?

Upvotes: 2

Views: 451

Answers (1)

Suban Dhyako
Suban Dhyako

Reputation: 2526

Use ExplicitWait method.

public static void ExplicitWait(MobileElement element){
        (new WebDriverWait(driver,30)).until(ExpectedConditions
                .elementToBeClickable(element));
    }

then before you use element of second fragment call ExplictWait

ExplictWait(passwordField);
passwordField.sendKeys("your password");

Upvotes: 2

Related Questions