I have an android appium test for my android app.
My app has a webview with loader at start.
I have a link I want to click.
The link should lead to another web-page.
My android appium clicks the link
but because the loader is on foreground and not the link
It seems that appium already clicked the link but the page didn’t change.
Is there a way to check a webElement is on the foreground? or other property I should wait for before clicking?
here is my code:
MyAndroidDriver myAD;
myAD.changeToWebContext();
myAD.changeToIFrame(By.name("braintree-dropin-frame"));
WebElement element = myAD.waitAndGetElementBy(By.id("choose-payment-method"));
if (element != null) {
element.click();
myAD.changeToDefaultIFrame();
myAD.changeToIFrame(By.name("braintree-dropin-modal-frame"));
while (myAD.waitAndGetElementBy(By.className("add-payment-method-link")) == null) {
myAD.changeToDefaultIFrame();
myAD.changeToIFrame(By.name("braintree-dropin-frame"));
myAD.waitAndClickElementBy(By.id("choose-payment-method"));
}
}
myAD.changeToNativeContext();