how to handle alerts in android using appium

0
0

How do I handle alerts in an Android web application using Appium server (1.0.1) and the Android SDK?

The below code is not working on android:

driver.switchTo().accept().alert();

Error message:

> -modal window does not get closed
  • You must to post comments
0
0

The best way is to use the appium inspector. Click on the element and copy the resource-id from it. Use this resource id in findElement(By.id()) method.

For me resource-id: android:id/button1

((AndroidDriver) driver).findElement(By.id("android:id/button1")).click();

This is for Android. For regular use you can use

driver.findElement(By.id("android:id/button1")).click();
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website