A dialog is implemented in such way in the app:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Something");
builder.setTitle("Something");
dialog = builder.create();
dialog.show();
How could I find this element in Appium testing script?
driver.switchTo().alert();
throws NotImplementError
driver.findElement(By.tagName("AlertDialog"))
is not working
And I found this issue Alert methods NYI on Github. Is there any workaround about this?
By the way, I'm not going to click on "OK" or "Cancel" on that dialog, I'm about to wait until that dialog disappears automatically.
Thanks in advance.
Please use the below code for your need:
To wait for the alert to appear:
wait.until(ExpectedConditions.alertIsPresent());
To wait for the alert to disappear:
wait.until(!ExpectedConditions.alertIsPresent());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With