Pages

Appium - How To Handle Alert Dialog Of Android App

Alert dialog Is common element of any android software app so you must know how to handle android app alert In appium or how to click on OK button of android app alert In appium automation test . You can get alert when you click button or check the check box to get confirmation. Alert dialog contains OK and Cancel buttons and you can click on OK or cancel button. Right now, There Is not any Implementation of alert In AndroidDriver. So we need to find some alternative to handle alert In android appium software automation test. We can treat alert same as other elements In our android appium software automation test.

App To Use In Test

We will use API Demos android software app In this test. You can download API Demos software app from THIS PAGE. Install API Demos app In your android device.

Aim To Achieve In Appium Android Test

We Wants to click on OK or Cancel button of alert In this appium android software automation test as shown In bellow Image.

Manually you can navigate to above alert dialog screen from Open API Demos app -> Tap on App -> Tap on Alert Dialogs -> Tap on OK Cancel dialog with a message button.

Comments are provided with every statement In above android appium test script. Selenium has Alert class to handle alerts of web application. But It still Alert class Is not Implemented with AndroidDriver so we can not use It In our test. Here we have located Alert text container and OK button manually. Also you can click on Cancel button of alert using last statement.