【问题标题】:WebdriverIO, IE11 window launches but errors in terminal: Request failed due to no such window, Currently focused window has been closedWebdriverIO,IE11窗口启动,但终端错误:由于没有这样的窗口,请求失败,当前焦点窗口已关闭
【发布时间】:2020-06-03 08:32:49
【问题描述】:

我对 WDIO 和 javascript 还很陌生,但我正在尝试让 WebdriverIO v6 与 IE11 一起工作。这一点很重要,因为我们为医疗行业制作软件,尽管这绝对是一种痛苦,但他们似乎只使用 IE11!

所以当我运行测试时,IE11 窗口被打开,它导航到我指定的 url,然后窗口保持打开并在视图中,而没有任何事情发生,而终端开始重复错误:

webdriver: Request failed with status 404 due to no such window: Currently focused window has been closed.

然后我需要手动关闭 IE11。在 Chrome 上,测试都运行良好。我不确定在这里做什么,谷歌搜索没有任何结果。 谢谢你

Image showing console errors

我的 wdio.conf.js 文件是:

var baseUrl;
var input = process.env.SERVER;

if (input == 'x') {
    baseUrl = 'x-foo.com';
} else {
    baseUrl = 'y-foo.com';
};

var timeout = process.env.DEBUG ? 9999999 : 15000;
exports.config = {

    runner: 'local',

    specs: [
        './features/**/*.feature'
    ],
    // Patterns to exclude.
    exclude: [
        // 'path/to/excluded/files'
    ],

    maxInstances: 5,

    capabilities: [
        // {
        //     browserName: 'chrome',
        //     maxInstances: 1,
        // },
        {
            browserName: 'internet explorer',

            maxInstances: 1,
            timeouts: { "implicit": 5000 },
        }
    ],
    logLevel: 'error',
    bail: 0,
    baseUrl: baseUrl,
    waitforTimeout: 10000,
    connectionRetryTimeout: 120000,
    connectionRetryCount: 3,
    services: ['selenium-standalone', 'iedriver'],
    framework: 'cucumber',
    reporters: ['spec'],


    //
    // If you are using Cucumber you need to specify the location of your step definitions.
    cucumberOpts: {
        // <string[]> (file/dir) require files before executing features
        require: ['./step_definitions/*.js'],
        // <boolean> show full backtrace for errors
        backtrace: false,
        // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
        requireModule: ['@babel/register'],
        // <boolean> invoke formatters without executing steps
        dryRun: false,
        // <boolean> abort the run on first failure
        failFast: false,
        // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
        format: ['pretty'],
        // <boolean> hide step definition snippets for pending steps
        snippets: true,
        // <boolean> hide source uris
        source: true,
        // <string[]> (name) specify the profile to use
        profile: [],
        // <boolean> fail if there are any undefined or pending steps
        strict: false,
        // <string> (expression) only execute the features or scenarios with tags matching the expression
        tagExpression: 'not @Pending',
        // <number> timeout for step definitions
        timeout: 60000,
        // <boolean> Enable this config to treat undefined definitions as warnings.
        ignoreUndefinedDefinitions: false
    },


    before: function (capabilities, specs) {
        require('expect-webdriverio') //based on Jasmine & Jest
    },

    afterStep: function ({ uri, feature, step }, context, { error, result, duration, passed, retries }) {
        // if (error) {
        //     const path =  './errorShots/'+Date.now()+ step +'.png';
        //     browser.saveScreenshot(path);
        // }
    },


    after: async function (result, capabilities, specs) {
        await browser.pause(1000);
    },

    afterSession: async function (config, capabilities, specs) {
        await browser.pause(1000);
    },

}

【问题讨论】:

  • 你在哪里找到的iedriver服务?

标签: webdriver internet-explorer-11 webdriver-io


【解决方案1】:

我设法通过从 Internet 选项(从 IE 浏览器上的工具菜单)启用保护模式来修复它。

【讨论】:

    猜你喜欢
    • 2018-05-03
    • 1970-01-01
    • 2014-12-23
    • 1970-01-01
    • 2011-03-07
    • 1970-01-01
    • 2012-06-05
    • 2015-03-28
    • 1970-01-01
    相关资源
    最近更新 更多