Appium [求助]怎么 appium For windows 1.1 报错

hwm831002 · 2014年06月05日 · 最后由 hwm831002 回复于 2014年06月05日 · 1917 次阅读

请问下我再 appium for windows1.0 版本上运行脚本通过,为什么在 appium For windows 1.1 报错

错误信息:

info: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"19","automationName":"Appium"}
info: No appActivity desired capability or server param. Parsing from apk.
ERROR: debug: Appium request initiated at /wd/hub/session
ERROR: debug: Request received with params: {"desiredCapabilities":{"app":"chrome","device":"Android"}}
ERROR: error: Using local app, but didn't end in .zip, .ipa or .apk
ERROR: error: Failed to start an Appium session, err was: Error: Bad app: E:\Appium\node_modules\appium\chrome. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk
info: No appPackage desired capability or server param. Parsing from apk.
info: Got configuration error, not starting session
info: Cleaning up appium session
info: Error: Bad app: E:\Appium\node_modules\appium\chrome. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk
at null. (E:\Appium\node_modules\appium\lib\devices\android\android-common.js:57:13)
at Device.configureLocalApp (E:\Appium\node_modules\appium\lib\devices\device.js:85:5)
at Device.configureApp (E:\Appium\node_modules\appium\lib\devices\device.js:56:10)
at androidCommon.configureApp (E:\Appium\node_modules\appium\lib\devices\android\android-common.js:72:35)
at androidCommon.configure (E:\Appium\node_modules\appium\lib\devices\android\android-common.js:38:10)
at Appium.configure (E:\Appium\node_modules\appium\lib\appium.js:268:15)
at Appium.start (E:\Appium\node_modules\appium\lib\appium.js:102:10)
at exports.createSession (E:\Appium\node_modules\appium\lib\server\controller.js:155:16)
at callbacks (E:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:164:37)
at param (E:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:138:11)
info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Bad app: E:\Appium\node_modules\appium\chrome. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk)","origValue":"Bad app: E:\Appium\node_modules\appium\chrome. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .apk"},"sessionId":null}
POST /wd/hub/session 500 44ms - 644b

共收到 11 条回复 时间 点赞

cause: Error: Using local app, but didn't end in .zip, .ipa or .apk 这不是写了么, 你的 app 名称错误

#1 楼 @cy_suncheng 但是我测试的是 android 平台的浏览器 没有 zip, .ipa or .apk

这里我也没设置

#3 楼 @xiaomayi0323
var androidCapabilities = new DesiredCapabilities();
androidCapabilities.SetCapability("app", "chrome");
androidCapabilities.SetCapability("device", "Android");
driverAndroidBrowser = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), androidCapabilities);
反正就是用的 sample 的代码

那你可以不配置 app, 直接配置 activities 试试, 在 0.18 时候可以, 但是 1.1 我不确定

1.0 的我也没配置 可以跑脚本通过 所以我就不知道为什么 1.1 的不可以

#5 楼 @cy_suncheng 上图是 1.0 的 appium 没有配置任何东西 可以运行脚本通过 但是 1.1 的一样的配置却不可以

#7 楼 @hwm831002 DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName","Android Emulator");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.example.android.apis");
capabilities.setCapability("appActivity", ".ApiDemos");
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
我看官方的例子是这样的,你确定 app 不是 path 就能通?

#8 楼 @cy_suncheng 确定的 都跑了很多次了 你贴的这个配置是跑 apk 的这种 我现在是跑模拟器上的 android 浏览器

#9 楼 @hwm831002 capabilities.setCapability("browserName", "chrome") 这样呢可以么

请贴代码. 另外不建议你使用图形界面.

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