Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

Why is Appium not detecting elements on the page?

The UiAutomator Viewer dumps the active window's view hierarchy, and the screenshot is taken from the default display. If you want to use UiAutomator Viewer to examine a screenshot of your app, you can create both files programmatically and provide them to UiAutomator Viewer:


adb shell am start com.google.android.calendar --display 0 
adb shell screencap -d 0 -p /sdcard/screencapture0.png
adb pull /sdcard/screencapture0.png . 
adb shell uiautomator dump 
adb pull /sdcard/window_dump.xml 
mv window_dump.xml window_dump0.uix

By selecting "Open" in the UiAutomator Viewer and selecting screencapture0.png and window_dump0.uix, you can open an app on the secondary display.

By opening an app on the secondary display, the focus moves to the other display, and you can reinvoke the same commands to get the two files:


adb shell am start com.google.android.calendar --display 1 
adb shell screencap -d 1 -p /sdcard/screencapture1.png 
adb pull /sdcard/screencapture1.png . 
adb shell uiautomator dump 
adb pull /sdcard/window_dump.xml 
mv window_dump.xml window_dump1.uix

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free