我正在尝试在 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();
})
});