Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appium Detect Alertdialog

Tags:

appium

I'm writing a UI test script in Python, after performing a click, there might be an alert window popping up. If so, I need to press a button on that window. I wonder if there's a way to detect alert dialogs in Appium API? Thanks.

enter image description here

like image 996
J Freebird Avatar asked Feb 10 '26 18:02

J Freebird


1 Answers

simple and best way is doing through capabilities

capabilities.setCapability("autoAcceptAlerts",true);

This will only accept alerts from your App and not the system Alerts.

like image 142
vishal Avatar answered Feb 15 '26 22:02

vishal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!