"use strict";
require("./helpers/setup");
var wd = require("wd"),
_ = require('underscore'),
serverConfigs = require('./helpers/appium-servers'),
Q = require('q');
describe("Windows test from Node", function () {
this.timeout(300000);
var driver;
var allPassed = true;
before(function () {
var serverConfig = serverConfigs.local;
driver = wd.promiseChainRemote(serverConfig);
require("./helpers/logging").configure(driver);
var desired = _.clone(require("./helpers/caps").CMS);
return driver
.init(desired);
});
after(function () {
return driver
.quit();
});
afterEach(function () {
allPassed = allPassed && this.currentTest.state === 'passed';
});
it("should open CMS.", function () {
return driver
.elementByName('CharwellDB').doubleclick()
.sleep(20000);
});
it("should login CMS.", function () {
return driver
.elementByAccessibilityId('m_tbUserID').sendKeys("CSDAdmin")
.elementByAccessibilityId('m_tbPassword').sendKeys("CSDAdmin")
.elementByAccessibilityId('m_btnOk').click();
});
});
您好,我正在使用https://github.com/Clemensreijnen/AppiumOnWindowsWithJS/blob/master/README.md 框架并尝试自动化桌面应用程序。在“应该打开CMS”,一个新的桌面窗口打开并且winappdriver无法在该窗口上找到该元素之后,我尝试使用WindowHandle但不适用于JavaScript,请提供一些建议,谢谢!!
答案 0 :(得分:0)
我找不到源代码,但是解决方案是在JavaScript中实现windowHandle和promise。