我第一次使用appium。我想在第三方安装的应用程序上运行简单的自动化。我想为该特定应用配置appium服务器。
我几乎没有问题:
哪些字段是强制性的?
我必须手动填写它们吗?因为我的Android插入了mac, 然而,我无法自动完成名称。
如何轻松找到所需的应用apk路径和它的启动活动(我猜双击apk之后?)
我现在收到以下错误:
不起作用。
新的控制台开启了:
➜ ~ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
医生:
运行Android检查
✔ ANDROID_HOME is set to "/Users/eladb/MyWorkspace2/adt-bundle-mac-x86_64/sdk/"
✔ JAVA_HOME is set to "/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home."
✔ ADB exists at /Users/eladb/MyWorkspace2/adt-bundle-mac-x86_64/sdk/platform-tools/adb
✔ Android exists at /Users/eladb/MyWorkspace2/adt-bundle-mac-x86_64/sdk/tools/android
✔ Emulator exists at /Users/eladb/MyWorkspace2/adt-bundle-mac-x86_64/sdk/tools/emulator
✔ Android Checks were successful.
✔ All Checks were successful
➜ ~
然而,appium说:
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"}}}
info: <-- GET /wd/hub/status 200 0.927 ms - 104 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.grindrapp.android","appActivity":".activity.SplashActivity","platformVersion":"4.4.2","browserName":"","platformName":"Android","deviceName":"10.0.0.9:5555"}}
info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session e232fa9d-a70c-4de9-84e7-d86441cc9dc6
info: Starting android appium
info: [debug] Getting Java version
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Could not get the Java version. Is Java installed?
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1040:17
at ChildProcess.exithandler (child_process.js:735:7)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Socket.<anonymous> (child_process.js:1176:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:476:12)
error: Failed to start an Appium session, err was: Error: Could not get the Java version. Is Java installed?
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not get the Java version. Is Java installed?)","origValue":"Could not get the Java version. Is Java installed?"},"sessionId":null}
info: <-- POST /wd/hub/session 500 87.838 ms - 222
info: --> GET /wd/hub/status {}
我使用的是appium 1.3.5
答案 0 :(得分:0)
您需要提及以下字段:
如果您不想在Appium中提及这些内容,您还可以使用功能类在脚本中提及它。
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Android");
capabilities.setCapability("platformVersion", "4.4.2");
capabilities.setCapability("appPackage", "something");
capabilities.setCapability("appActivity", "something");
capabilities.setCapability("udid", udid);