Handle mobile application or browser alerts with appium

mobileAlertsWe have seen how to handle alerts for desktop browsers using selenium, the same way we have alerts for mobile or handheld devices.

With handheld devices we have 2 types of alerts

  • Native app alerts
  • Mobile browser alerts

Let’s understand how each alerts are different and how to handle them using appium

Native app alerts:

Alerts for android apps (.apk) are part of the application but not system alert, and can be identified as usual by using UiAutomatorViewer tool (with appium locators).

Observe below screenshot and get the locator details for the “I agree” and “No, no”

nativealerts1

Let’s implement the appium test on the app alert..




Browser alerts:

Alerts from browser actions, like confirmation/warning alerts while

  • submitting registration pages
  • navigating away from browser while payment is in progress.. etc

These types of alerts can’t be identified by uiautomatorviewer tool, we have to switch to alert and act on them like we did with desktop browser alerts. read handling browser alerts in selenium

 

Content posted is based on learning or working experience, Share the post with others if find useful, Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: