Appium/Appium Inspector version: Version 1.15.1 (1.15.1.20191013.2)
Issue:
I am unable to inspect a picker/dropdown. It doesn’t appear in the app source at all. Hence unable to find any locators to do further automation.
Steps:
I open the android app on the mobile and navigate to a form where certain details need to be filled.
One of the things to be filled is a dropdown.
I click on the arrow on the dropdown field
A NEW window/popup appears on top of the ORIGINAL form for the picker values to be displayed, which can be scrolled to see various values.
This new picker value window/pop up doesnt not come in the app source in the appium inspector at all
Can you please tell me a workaround to automate this scenario to select values in the dropdown.I am using Java + Selenium + Appium for the automation framework.
I just took a sample screenshot from google. I couldn’t find anything more similar to my situation
But this is how it looks on my ANDROID app. If it makes any sense.
Thanks
The suggestion “((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.DPAD_DOWN));
((AndroidDriver) driver).pressKey(new KeyEvent(AndroidKey.ENTER));” is not working.
Since its a fixed drop down , there is no keyboard or any text to be searched. We have to scroll the picker to select existing values.
Any reason why appium is unable to inspect these elements?
Is it because its a Native React application?
Appium (or better to say UiAutomator) can only inspect something that is exposed to the Accessibility layer. If the app does not expose views then these won’t be visible in UIA as well.
even if web context absent is still DOES NOT guarantee that it not exist in app. e.g. as mentioned mykola-mokhnach your webView maybe disabled for debug and thus not visible in any context. better double check with developer. But if you said “react native hybrid app” - it means webView must be here.
it will be a bit help if you see your app page source with printing “driver.getPageSource()”.
Can you provide the appium readout for XML? It would help me understand what is going on from a debugging standpoint.
iOS pickers that are native can usually be interacted with the send_keys method.
For android I usually just scroll down on the element for a certain amount of pixels relative to the device window to ‘scroll’ down then check the value of the focused element and then compare to my desired.