Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11First identify what is blocking the test: a WebDriver alert, a native operating-system permission prompt, or a dialog built into the app. “Alert” and “popup” are everyday labels, not reliable clues to which Appium API will work. Handle the specific control deliberately whenever the test needs to verify what appeared or choose among different responses.
Identify the kind of dialog before interacting with it
When a test stalls, capture the page source and a screenshot while the dialog is visible. Its owner and accessibility representation determine the right interaction:
As an Amazon Associate I earn from qualifying purchases.
- WebDriver alert: A browser-style alert, confirmation, or prompt exposed through WebDriver’s alert interface. Use the alert API, not an element locator.
- Native OS permission prompt: A system-owned request such as iOS location or photo access. Use the platform driver’s documented permission or alert behavior.
- App-owned dialog: UI implemented by the app. Inspect the accessibility hierarchy and click its actual button or other control as a normal UI element.
Appium is an open-source UI automation project and ecosystem for mobile, browser, desktop, and other app platforms (Appium Documentation). The same visible wording can therefore call for different handling depending on the app and driver.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesUse an explicit wait and handle WebDriver alerts through the alert API
For a browser alert, wait until it exists before reading text or responding. The following Python helper uses Selenium’s current driver.switch_to.alert spelling and works with an Appium driver that exposes a WebDriver alert. Pass accept=True to accept; the default dismisses.
#1 Best Overall
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def handle_webdriver_alert(driver, accept=False, timeout=10):
alert = WebDriverWait(driver, timeout).until(EC.alert_is_present())
text = alert.text
if accept:
alert.accept()
else:
alert.dismiss()
return text
# Example after creating an Appium WebDriver session:
text = handle_webdriver_alert(driver, accept=True, timeout=10)
assert "expected message" in text
The helper returns the alert text before closing it, so the test can assert the expected message. Choose the response based on the test case rather than accepting every alert by default. A timeout means the expected WebDriver alert did not become available within the chosen interval; it does not prove that no other kind of dialog is present.
Handle iOS system alerts with XCUITest deliberately
The XCUITest driver documents two session capabilities for automatic handling:
Rank #2
appium:autoAcceptAlertsaccepts iOS alerts automatically.appium:autoDismissAlertsdismisses iOS alerts automatically.
Both default to false. The documented automatic behavior includes privacy permission alerts for location, contacts, and photos (XCUITest Driver capabilities).
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use an automatic capability only when the test’s intent is to accept or dismiss every alert it encounters. It can otherwise conceal an unexpected prompt or prevent the test from checking its text and choosing differently for distinct prompts. For per-prompt assertions or choices, leave blanket handling off and interact with each prompt as it appears.
Rank #3
Handle Android permissions and alerts with UiAutomator2
Granting app permissions at startup
UiAutomator2’s appium:autoGrantPermissions capability grants requested app permissions automatically at test start when its documented conditions are met: the app’s target SDK must be at least 23, and the device must be Android 6 / API 23 or newer. It defaults to false. This is broad startup behavior, not a way to inspect and make a different choice for each visible prompt. Special permissions may need another method, such as the documented mobile: changePermissions extension (UiAutomator2 driver documentation).
Responding to a visible Android alert
UiAutomator2 documents the mobile: acceptAlert and mobile: dismissAlert extensions. Each accepts an optional buttonLabel naming the button to click; if omitted, the driver attempts to detect a suitable button. The driver warns that these commands are not always reliable because Android alerts do not have one standard accessibility representation.
If an extension fails, inspect the source and screenshot, identify the dialog’s accessible controls, and use normal element interactions where possible. Do not assume a visible Android permission prompt is an iOS alert or that an iOS capability controls Android behavior.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Change session behavior at the right time
Capabilities are set when the session starts. Appium’s session guide states, “Capabilities are the core parameters used to start an Appium session.” They cannot be changed during that session’s lifecycle (Appium Documentation: Session Capabilities).
Best Value
Appium Settings are different: they can be mutable during a session, but are driver-specific and affect Appium’s automation behavior rather than changing the app or device itself. Do not assume an alert capability has a runtime equivalent. Check the current settings reference for the specific driver before relying on a setting to change alert behavior mid-session.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.A practical workflow for a blocked test
- Wait for the expected dialog. Use an explicit wait for the relevant alert or UI condition instead of a fixed sleep.
- Observe it while present. Save a screenshot and page source. Determine whether it is a WebDriver alert, system permission prompt, or app-owned dialog.
- Choose the matching interaction. Use the WebDriver alert API for browser alerts; driver-documented behavior for native prompts; and an accessible locator for app-owned controls.
- Make platform-specific choices. On iOS, handle prompts individually when the test must distinguish them. On Android, use auto-grant only when its conditions and broad behavior fit; for other visible alerts, try the documented UiAutomator2 extension or accessible controls.
- Assert the resulting state. Verify the expected permission, screen, or app behavior after responding. This helps catch unexpected prompts that blanket automation could hide.
Troubleshooting common failures
- The alert wait times out: The prompt may not be a WebDriver alert, may not have appeared, or may already have disappeared. Check the screenshot and source while the test is blocked, then use the matching dialog method.
switch_to.alertcannot find the prompt: That API handles WebDriver alerts, not arbitrary native or app-owned dialogs. Inspect the accessibility hierarchy and use the native driver behavior or an element locator instead.- UiAutomator2 accept or dismiss does not work: Android alerts have no single standard accessibility representation, and the driver documents reliability limits. Capture evidence, identify the controls, and interact with them as elements if accessible.
- An iOS prompt disappears or is accepted unexpectedly: Check whether
appium:autoAcceptAlertsorappium:autoDismissAlertswas set at session creation. Disable blanket handling when the test needs to inspect individual prompts. - Android permissions were not auto-granted: Confirm the target SDK and Android API-level conditions, and check whether the permission is special and requires a different documented method.
- You need to change an option mid-session: Capabilities are startup parameters. Look for a driver-specific mutable setting, but do not infer one exists from the capability name.
Or skip the browser setup
ScreenshotNeo is a website screenshot API, not an Appium popup handler; it does not replace the workflow above for mobile system dialogs. For capturing a web page without setting up a browser locally, one GET request returns an image or PDF. See the ScreenshotNeo API documentation.
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month without a card, and paid plans start at $5 for 3,000. Sign up free for 1,000 screenshots a month, no card required.
Recommended Free Tools
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




