I am pretty new to WDIO and javascript, but am trying to get WebdriverIO v6 working with IE11. This is important since we make software for the medical industry who only seem to use IE11 despite it being an absolute pain!

So when I run the test, the IE11 window is opened, it navigates to the url I specified, then the window remains open and in view whilst nothing more happens, whilst the terminal starts to error repeating:

webdriver: Request failed with status 404 due to no such window: Currently focused window has been closed. I then need to close IE11 manually. On Chrome the tests all run fine. I am not really sure what to do here and googling hasn't resulted in anything. Thankyou

My wdio.conf.js file is

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: [
    // 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);


2 Answers 2


You have to add kilinstances: true to delete everything at the end:

export.config = {

  services: [['iedriver',{killInstances:true}]],
  // ...

  capabilities: [
        browserName: 'internet explorer',

        maxInstances: 1,
        timeouts: { "implicit": 5000 },


  • Thanks so much for coming to reply! I will certainly add that, the issue is more that none of the test steps run as the terminal is reporting that the window has already closed, so on a login test for example, the url is navigated to, but the username/password is not input, the terminal reports: webdriver: Request failed with status 404 due to no such window: Currently focused window has been closed. and the window is open doing nothing at all - the driver is not interacting with the screen to perform the test
    – StarBuck
    Jun 4, 2020 at 15:37

I managed to get this working following this advice - https://stackoverflow.com/questions/47388733/selenium-org-openqa-selenium-nosuchwindowexception-currently-focused-window-ha

setting the internet options to enable protected mode is now interacting with the site, but the next issue the input is only writing one character every couple of seconds. Off to find the next answer...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.