Skip to content

Unable to click a button (testing)

My project is automation testing on voot app using appium(android),selenium (java) I am using appium desktop inspector to locate the id/xpath of an element and copying that in eclipse. There is a “GOT IT” button on the home page without an id or xpath, how do i go about it

package tests;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import io.appium.java_client.touch.offset.PointOption;
public class test extends BaseClass{
    public void test1(){
            driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS); 
            MobileElement el1 = (MobileElement) driver.findElementById("");
            System.out.println("Completed test1");
            MobileElement el2 = (MobileElement) driver.findElementById("");
            System.out.println("Completed test2");
            MobileElement el3=(MobileElement) driver.findElementById("");
            MobileElement el4=(MobileElement) driver.findElementById("");
            System.out.println("completed test2");
        public void test2() {
            MobileElement el5=(MobileElement) driver.findElementById("");
            System.out.println("Completed test3");
    public void test3() {
        MobileElement el6=(MobileElement) driver.findElementById("");;
        driver.manage().timeouts().implicitlyWait(10000, TimeUnit.SECONDS); 
        TouchAction action0=new TouchAction(driver); //not working
        action0.tap(PointOption.point(612,1329)).perform();//not working




driver.findElementByName(“GOT IT”).click();


use the position of the button and make it.(APPIUM, how to get x and y coordinates for swiping)

User contributions licensed under: CC BY-SA
4 People found this is helpful