0
"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 框架并尝试自动化桌面应用程序。在“应该打开 CMS”之后,打开一个新的桌面窗口,winappdriver 无法在该窗口上找到元素,我尝试使用 WindowHandle 但与 JavaScript 不兼容,请提供一些建议,提前谢谢!

4

1 回答 1

0

我找不到我的源代码,但解决方案是在 JavaScript 中实现 windowHandle 和 promise。

于 2019-03-14T02:25:00.580 回答