Handle Alert in Appium

Let’s see, How can you handle Alert in Appium. In previous tutorials, You have seen, How to take Screenshot on Android using Appium. Now we will see, How can we Handle Alerts Dialog box in Andriod Application.


An alert dialog is a common element in Android Apps. So you must know how to handle android app alert In Appium. You can get Alert when you click the button or check the check box to get confirmation. The alert dialog contains OK and Cancel buttons and you can click OK or cancel button.


Right now, There is not any Implementation for Alert in AndroidDriver.

So we need to find some alternative to handle Alert in Android Appium Automation. We can treat alert same as other elements in our Android Automation Test.


Handle Alert in Appium

Suppose we have a scenario, Where an Alert box will appear once you will click on Element contains the text “Continue“.


In below-attached example, We are handling the Alert using Appium. You can try this Test Script in Your Local machine.

In the above Test Script, First we scroll to our target Element “Continue” then click it.

Now an Alert dialogue will come, We find the alert as other elements and click on a button which contains the text “OK“.


Using this way, You can handle the Alert Box in Appium.

0 Comment

Leave a Reply