How to get x,y coordinates of android native app using selenium java web driver.
I am using appium. My app opens the android image gallery. As the uiautomatorviewer doesn't show the layout for it. I couldn't able to click an image.
Looks like moveToElement, mouseMoveAt etc is working only for browsers. What are the options available for native app.
I found a solution by using the below code. By tapping in a certain position I could able to pick an image.
HashMap<String, Integer> tapObject = new HashMap<String, Integer>();
tapObject.put("x", 100); // in pixels from left
tapObject.put("y", 300); // in pixels from top
driver.executeScript("mobile: tap", tapObject);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With