How to find X and Y co-ordinate of a particular element?



WebElement acceptButton= driver.findElement(By.xpath("//android.widget.Button[@resource-id='com.pcloudy.appiumdemo:id/accept']")); 
By this below script we can get the xcordinate of the particular element
acceptButton.getLocation().getX();
By this below script we can get the Ycordinate of the particular element
acceptButton.getLocation().getY();

Leave a Reply

Your email address will not be published. Required fields are marked *