Couldn't inspect elements on mobile Android app using uiautomator viewer

Multi tool use
Couldn't inspect elements on mobile Android app using uiautomator viewer
I'm trying to automate android mobile app using selenium/java with appium. I connected the android device to my pc and trying to inspect the elements on app screen after taking the screenshot using uiautomator viewer. But the whole screen is displayed inside single frameLayout and I couldn't inspect each element inside the frame.
I tried with chrome inspect as well but elements are not detected using chrome inspector.
Can sometime please help on this?
have you try to switch to frame. I have added a example .. try that also
– Shubham Jain
Sep 12 '17 at 6:54
1 Answer
1
This is the similar question I have put up some time ago:
How to tap on a element which is focused in appium. Unable to select value of a dropdown in appium
One of the thing you can try by switch to frame if any frame present.
ad.switchTo().frame(ad.findElement(By.xpath("YOURXPATH")));
Try using driver.getPageSource();
. It will return you XML DOM, if you are getting the value then it is good. Write a XPath for same.
driver.getPageSource();
Either you just need to use co-ordinare and then using tab
Below code work for me
By filter =By.xpath("MYLOCATOR");
System.out.println("About to click on result");
Point point = ad.findElement(filter).getLocation();
int elementCenterX = point.getX() + 80;
int elementCenterY = point.getY() + 100;
System.out.println("value of x = "+elementCenterX+" value of y = "+elementCenterY);
ad.tap(2, elementCenterX , elementCenterY , 0);
Note:- you need to adjust X and Y as per your requirement in above code and pass the nearest locator like text box of the dropdown.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Can you please add the screenshot from the uiautomator?
– Vinod
Sep 11 '17 at 15:42