【发布时间】: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 上,测试都运行良好。我不确定在这里做什么,谷歌搜索没有任何结果。 谢谢你
我的 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