Nightwatch: IE Browser: When running the command Change window focus ['Error while running .switchToWindow() protocol action: Missing parameter: name']

Created on 20 Sep 2019  路  9Comments  路  Source: nightwatchjs/nightwatch

Test to reproduce

single_test.js from https://github.com/browserstack/nightwatch-browserstack


// Please add the sample test here

var request = require("request");

var request = require("request");

let originDestKeys = "";
module.exports = {
  //working
  'Switch Window' : function (browser) {
    browser
      .url('http://toolsqa.com/automation-practice-switch-windows/')
      .title()
      .click('xpath', '//*[@id="cookie_action_close_header"]')
      .click('xpath', './/button[contains(.,\'New Browser Window\')]')
      browser.windowHandles(function (result) {
        // 0 == current main window, 1 == new tab
        var handle = result.value[1]
        browser.switchWindow(handle)
    })
    // do something
    browser.closeWindow() // Close tab
    // Switch to main window
    browser.windowHandles(function (result) {
        // 0 == current main window, 1 == new tab
        var handle = result.value[0]
        browser.switchWindow(handle)
    })
      .end();
  }
}

Run with command

$ npm run single

Verbose output

debug.log


https://gist.github.com/amit-punjabi/9e5702d38253fd7ee0427527fbad8fb4

Configuration

single.conf.js


{
  nightwatch_config = {
  src_folders : [ "tests/single" ],

  selenium : {
    "start_process" : false,
    "host" : "hub-cloud.browserstack.com",
    "port" : 4444
  },

  test_settings: {
    default: {
      desiredCapabilities: {
        'browserstack.user': 'USERNAME',
        'browserstack.key': 'ACCESS_KEY',
        'os': 'Windows',
        'os_version': '10',
        'browserName': 'internet explorer',
        'browserVersion': '11.0',
        'resolution' : '1920x1080'
      }
    }
  }
};

// Code to copy seleniumhost/port into test settings
for(var i in nightwatch_config.test_settings){
  var config = nightwatch_config.test_settings[i];
  config['selenium_host'] = nightwatch_config.selenium.host;
  config['selenium_port'] = nightwatch_config.selenium.port;
}

module.exports = nightwatch_config;
}

Your Environment

| Executable | Version |
| ---: | :--- |
| nightwatch --version | 0.8.18 |
| npm --version | 5.6.0 |
| node --version | 8.11.4 |

| Browser driver | Version |
| --- | --- |
| IE | v2.41 |

| OS | Version |
| --- | --- |
| Windows | 10 |

stale

Most helpful comment

This seems to still be a problem and I cant find a work around.

@beatfactor Any chance of this getting fixed?

All 9 comments

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

This used to work, would this issue has to do with nightwatch version? @amit-punjabi are you able to try on the new version and update the issue please? Thanks!

I'm using the latest version and having the same issue.

Executable | Version
-- | --
nightwatch --version | 1.3.2
npm --version | 6.12.1
node --version | 12.13.1

This seems to still be a problem and I cant find a work around.

@beatfactor Any chance of this getting fixed?

I am experiencing the same issue. Works for Chrome and Firefox, but not for IE

Any update on this issue?

Same here, it works for Chrome & Firefox but facing this issue for IE11.

fyi @anujdagar07 @ituradastra @unicron @tosborne1215 @micky2be @amit-punjabi
Some update for people who blocked out there:

we were using BrowserStack initially and it used to work and at some point it was not working so we open this ticket via BrowserStack, and it end up created the thread here.

I noticed the failure primary was cause by IE 11 browser on BrowserStack end that pops up were disabled by default, cause the script not able to open the new tab. BrowserStack have the capability that can turn the pop up back on. That resolved the issue.

Te script with selenium 3.14159 + IE driver 3.14159 is working as expected, and below is the capability provided from BrowserStack that solved this issue.
'browserstack.ie.driver': '3.141.59',
'browserstack.ie.enablePopups': true,
'browserstack.ie.ensureCleanSession': true,

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gary5 picture gary5  路  4Comments

bushev picture bushev  路  4Comments

davidlinse picture davidlinse  路  4Comments

MateuszJeziorski picture MateuszJeziorski  路  3Comments

willli666 picture willli666  路  3Comments