我在谷歌搜索并看到类似的java代码:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
capabilities.setCapability("device", "Android");
capabilities.setCapability(CapabilityType.VERSION, "4.2");
capabilities.setCapability(CapabilityType.PLATFORM, "Windows");
capabilities.setCapability("app", "C:\\Android Apps\\Calculator.apk");
//This is path of your application
capabilities.setCapability("app-package", "com.calculator");
// This is package name of your app
capabilities.setCapability("app-activity", "MainActivity");
// This Launcher activity of your app
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
但是我不明白在哪里编写代码以及之后如何编写测试用例并执行。如果逐步指导我,我将不胜感激。