0

我正在尝试在 Windows 10 64bit 上运行一个启动计算器应用程序的简单测试,我已经安装了 appium@1.6.3。根据安装 appium 的文档,还将安装 winappdriver。但是,当我尝试运行测试时,我看到以下错误,它抱怨未安装 winappdriver。

C:\WINDOWS\system32>appium
[Appium] Welcome to Appium v1.6.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"Windows","deviceName":"WindowsPC"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","platformName":"Windows","deviceName":"WindowsPC"},null,null,null,null]
[Appium] Creating new WindowsDriver session
[Appium] Capabilities:
[Appium]   app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
[Appium]   platformName: 'Windows'
[Appium]   deviceName: 'WindowsPC'
[BaseDriver] The following capabilities were provided, but are not recognized by appium: app.
[BaseDriver] Session created with session id: c0c6c7e6-b782-4b14-8192-bc78e5b38008
[WinAppDriver] Verifying WinAppDriver is installed with correct checksum
[HTTP] <-- POST /wd/hub/session - - ms - -
[debug] [WinAppDriver] Deleting WinAppDriver session
[MJSONWP] Encountered internal error running command: Error: Could not verify WinAppDriver install; re-run install
    at WinAppDriver.start$ (../../lib/winappdriver.js:35:13)
    at tryCatch (C:\Users\bhawsar\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\bhawsar\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\bhawsar\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (C:\Users\bhawsar\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)

还附上我的测试脚本:

var wd = require("wd");
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
var should = chai.should();
//enable chai assertion chaining
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

var serverConfig = {
    host:'127.0.0.1',
    port:4723,

};

var capabilities = {
    app:'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App',
    platformName:'Windows',
    deviceName:'WindowsPC'
};

var driver;

describe('test calculator',function(){
it('test launch calculator',function(done){

  driver = wd.promiseChainRemote(serverConfig);
  console.log(driver)
  this.timeout(10000);
    var cap=driver.init(capabilities);
    console.log(cap)
         done();
})
});
4

3 回答 3

0

我知道我的回复为时已晚

我只是想让其他人知道appium中使用的win app驱动版本太旧(0.7)所以直接从GitHub下载(0.9)

于 2017-06-05T18:22:53.793 回答
0

我注意到appium的版本和windows驱动有紧密的依赖关系。通过桌面应用程序安装 appium 时,它不起作用。你得到错误的版本。

安装时,它会在您的 appdata/temp 文件夹中下载 Windows 驱动程序。你应该删除它。

当通过 nmp 安装 appium 时,它会更好地工作,这会下载正确的 windows 驱动程序。

当你没有删除临时文件夹下载时,这个也会失败,因为它需要那个 Windows 驱动程序......

于 2017-12-05T05:01:48.707 回答
0

您是否首先安装了 WinAppDriver?https://github.com/Microsoft/WinAppDriver/releases , WindowsApplicationDriver.msi

注意:目前它仅适用于 Win 10。

于 2017-03-12T14:37:11.510 回答