创建桌面应用程序的新 window 时,WinAppDriver 找不到元素
WinAppDriver canonot find element when new window of desktop application created
"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("")
.elementByAccessibilityId('m_tbPassword').sendKeys("")
.elementByAccessibilityId('m_btnOk').click();
});
});
嗨,我正在使用 https://github.com/Clemensreijnen/AppiumOnWindowsWithJS/blob/master/README.md
框架并尝试自动化桌面应用程序。在 "should open CMS" 之后,一个新桌面 window 打开并且 winappdriver 无法找到那个 window 上的元素,我尝试使用 WindowHandle 但不适合 JavaScript,请多多指教,先谢谢了!
我找不到我的源代码,但解决方案是在 JavaScript 中实现 windowHandle 和 promise。
"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("")
.elementByAccessibilityId('m_tbPassword').sendKeys("")
.elementByAccessibilityId('m_btnOk').click();
});
});
嗨,我正在使用 https://github.com/Clemensreijnen/AppiumOnWindowsWithJS/blob/master/README.md 框架并尝试自动化桌面应用程序。在 "should open CMS" 之后,一个新桌面 window 打开并且 winappdriver 无法找到那个 window 上的元素,我尝试使用 WindowHandle 但不适合 JavaScript,请多多指教,先谢谢了!
我找不到我的源代码,但解决方案是在 JavaScript 中实现 windowHandle 和 promise。