Virtual device troubleshooting
This section provides resources for problems that you may encounter when working with virtual devices.
Chrome pop-up window interferes with video content
When you work with Google Chrome version 103 on an Android 13 emulator, a pop-up window asking for notification permissions appears on the screen. This creates a problem during automation testing: While the pop-up window does not prevent you from interacting with elements on the web page, it does interfere with properly viewing the test video. To remove the pop-up window, you can dismiss the message or continue to allow notifications.
To dismiss the message, add the following step to your automation tests:
Copy
try {
driver.context("NATIVE_APP"); // switch to native context
driver.findElement(By.id("com.android.chrome:id/negative_button")).click(); // 'No thanks' button
} catch (RuntimeException e) {
System.out.println("The massage window is not present");
} finally {
driver.context("CHROMIUM"); // switch back to web context
}
To continue and allow notifications, add the following step to your automation tests:
Copy
try {
driver.context("NATIVE_APP"); // switch to native context
driver.findElement(By.id("com.android.chrome:id/positive_button")).click(); // 'Continue' button
/* sleep might be needed here */
driver.findElement(By.id("com.android.permissioncontroller:id/permission_allow_button")).click(); // Allow notifications
} catch (RuntimeException e) {
System.out.println("The massage window is not present");
} finally {
driver.context("CHROMIUM"); // switch back to web context
}