Appium 各位大神进来看一下,我测试安卓 4.4 的时候,APPIUM 启动报错。。求助

海鸥 · 2014年12月12日 · 最后由 johnfad 回复于 2014年12月14日 · 1578 次阅读

-------------------------------这是初始化原码部分
public static AppiumDriver setUpAppium(String apkname,String version,String apppackage,String appactivity){
AppiumDriver appium = null;
File app=new File(System.getProperty("user.dir")+"//"+apkname); //"MobilePayment.apk"
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","Android");
// capabilities.setCapability("automationName", "Appium");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability(CapabilityType.VERSION, version); //"4.2.2"
capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("app-package", apppackage); //"com.ysepay.mobileportal.activity"
capabilities.setCapability("app-activity", appactivity); //"com.ysepay.mobileportal.IndexActivity"

try {
appium = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
appium.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
return appium;
}

}

---------------------------------------------------报错日志-------------------------------

Starting Node Server
info: Welcome to Appium v1.1.0 (REV e433bbc31511f199287db7724e1ce692bcb32117)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: socket.io started
info: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"18","automationName":"Appium"}
ERROR: debug: Appium request initiated at /wd/hub/session
info: No appActivity desired capability or server param. Parsing from apk.
ERROR: debug: Request received with params: {"desiredCapabilities":{"platform":"WINDOWS","app":"D:\workspace\moblieAPP_automation\MobilePayment.apk","browserName":"","app-package":"com.ysepay.mobileportal.activity","device":"Android","app-activity":"com.ysepay.mobileportal.IndexActivity","version":"4.4"}}
info: No appPackage desired capability or server param. Parsing from apk.
ERROR: debug: Using fast reset? true
info: Using local app from desired caps: D:\workspace\moblieAPP_automation\MobilePayment.apk
info: Creating new appium session 602ccf2d-db0f-4ae6-873d-7d03fdc0945f
ERROR: debug: executing: "D:\android\android-sdk-windows\platform-tools\adb.exe" devices
info: Starting android appium
info: Preparing device for session
info: Checking whether app is actually present
info: Checking whether adb is present
info: [ADB] Using adb from D:\android\android-sdk-windows\platform-tools\adb.exe
info: Trying to find a connected android device
info: [ADB] Getting connected devices...
info: [ADB] 1 device(s) connected
ERROR: debug: executing: "D:\android\android-sdk-windows\platform-tools\adb.exe" -s emulator-5554 wait-for-device
info: Setting device id to emulator-5554
info: [ADB] Waiting for device to be ready and to respond to shell commands (timeout = 5)
ERROR: debug: executing: "D:\android\android-sdk-windows\platform-tools\adb.exe" -s emulator-5554 shell "echo 'ready'"
info: Starting logcat capture
info: Checking whether aapt is present
ERROR: debug: executing: "D:\android\android-sdk-windows\platform-tools\adb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk"
info: Getting device API level
info: Device is at API Level 19
ERROR:

Node Server Process Ended

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 2 条回复 时间 点赞

测试设备的 android 版本必须是 4.2.0 以上。如果没有 android 版本没有这么高,建议使用 selenium 模式

#1 楼 @michaelian 怎么用 selendroid 模式呢? api 和 appium 有区别吗?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册