public class Mobiletest {
private static AndroidDriver driver;
public static void main(String[] args) throws MalformedURLException,
InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "Redmi 1s");
capabilities.setCapability("platformVersion", "4.4.4");
capabilities.setCapability("platformName", "Android");
// capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage",
"com.zipgo.customer");
capabilities.setCapability("appActivity",
"SplashActivity");
capabilities.setCapability(
MobileCapabilityType.NEW_COMMAND_TIMEOUT,
"100");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
它顯示了以下錯誤在Appium:driver = new AndroidDriver(new URL(「http://127.0.0.1:4723/wd/hub」),capabilities);在appium
在該行
- AndroidDriver cannot be resolved to a type
- driver cannot be resolved to a variable
我已經加入GSON罐子和java客戶端jar文件也
你能顯示更多的代碼嗎?你如何定義'driver'變量? – nano
以上是代碼 – Jagaur
使用AppiumDriver代替Android驅動程序。它必須是「私有靜態AppiumDriver驅動程序;」 –