我想運行一個簡單的測試在Windows 10 64位上啓動計算器應用程序,我已經安裝了[email protected]。根據安裝appium的文檔,winappdriver也將被安裝。但是,當我嘗試運行我的測試時,我看到下面的錯誤,其中抱怨winappdriver未安裝。不能得到WinAppDriver與appium 1.6.3工作
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();
})
});
是的,我做到了,C:\ Program Files文件(x86)的\ Windows應用程序驅動程序。我也只贏了10場。我跟着https://jeremylindsayni.wordpress.com/2016/11/18/testing-your-windows-app-with-appium-in-windows-10-and-visual-studio-2015/。但它不適合我。 – PB13
順便說一句,找到了一些相關的東西:https://github.com/Microsoft/WinAppDriver/issues/100 對於我這樣做在java中,WinAppDriver似乎開始好(硒-java v。3.2.0,appium java-客戶端5.0.0-BETA5),一切工作正常。 – Zaziro