Telmo, thx for fast answer. But I still can't understand how to put it in my code.
My code:
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidKeyCode;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.MalformedURLException;
import java.net.URL;
public class GameTest {
public static void main(String[] args) throws MalformedURLException, InterruptedException {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName","G9AXGY0336745E");
caps.setCapability("platformName","Android");
caps.setCapability("app","C:\\Appium\\node_modules\\appium\\build\\unlock_apk\\unlock_apk-debug.apk");
AndroidDriver driver = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);
driver.pressKeyCode(AndroidKeyCode.HOME);
Thread.sleep(2000);
driver.findElementByAndroidUIAutomator("new UiSelector().description(\"Apps\")").click();
driver.findElementByAndroidUIAutomator("new UiSelector().text(\"FunnyFarm\")").click();
Thread.sleep(5000);
So, after I opened this app (its a game). I need to tap "start" button.
I just need to add
TouchAction touchAction=new TouchAction(driver);
touchAction.tap(xPoint, yPoint).perform();
and instead xPoint and yPoint trying to guess what are coordinates of this button? Or how it should works