nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.8k stars 1.31k forks source link

Multiple Switch Windows does not work on Firefox but works on Chrome. #2226

Closed phaseen closed 4 years ago

phaseen commented 4 years ago

I am running nighwatch automation on Selenium Grid Server which is windows 10 machine:

Here is my Env Details:

Nigthwatch verison : 1.2.4 Selenium Version : 3.141.59 Firefox Version: 68.1.0esr (32-bit) GeckoDriver : v0.26.0

As per test 3 windows are open one is default and another two windows, i see that its switching fine to second window from default one but does not switch to third window i am using below command to switch window, same code works perfect in chrome, firefox gives me error as its not switching to correct window it fail to find element which we are searching on the 3rd window.

result.value[2] ---Third Window result.value[1] ----Second Window result.value[0]-----default one

                  // Move the current window to Developer window

                  browser.windowHandles(function (result) {
                      newWindow = result.value[2];
                      this.switchWindow(newWindow);
                    })

Response 500 POST http://xxxxx:2801/wd/hub/session/e3922c49-787d-48a1-9750-1902eb39a432/element/0e7a9aae-9fbd-4c88-a90a-0d9c8cd47cb8/click (65ms) { state: 'element not interactable', sessionId: null, value: { systemInformation: 'System info: host: \'xxxxx\', ip: \'xxxxxx\', os.name: \'Windows 10\', os.arch: \'x86\', os.version: \'10.0\', java.version: \'1.8.0_221\'', message: 'Element

could not be scrolled into view', error: [ 'Build info: version: \'3.141.59\', revision: \'e82be7d358\', time: \'2018-11-14T08:25:53\'', 'System info: host: \'xxxxx\', ip: \'xxxxxx\', os.name: \'Windows 10\', os.arch: \'x86\', os.version: \'10.0\', java.version: \'1.8.0_221\'', 'Driver info: driver.version: unknown' ] }, status: 60 } Error while running .clickElement() protocol action: Element
could not be scrolled into view

TimeoutError: An error occurred while running .click() command on <div#aliveButton div.left>: {"status":-1,"state":"element not interactable","value":{"systemInformation":"System info: host: 'xxxxx', ip: '1xxxxxx', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_221'","message":"Element <div class=\"left\"> could not be scrolled into view","error":["Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'","System info: host: 'xxxxxx', ip: 'xxxxx', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_221'","Driver info: driver.version: unknown"]},"errorStatus":60,"error":"Element <div class=\"left\"> could not be scrolled into view","httpStatusCode":500} at process._tickCallback (internal/process/next_tick.js:68:7) ✖ Timed out while waiting for element <input#understandCheckBox> to be present for 16000 milliseconds. - expected "visible" but got: "not found" at NightwatchAPI. at process._tickCallback (internal/process/next_tick.js:68:7)

nightwatch.conf.js

"firefox": {
  "desiredCapabilities": {
    "browserName": "firefox",
    "platform": "WINDOWS",
    "javascriptEnabled": true,
    "acceptSslCerts": true,
    "webStorageEnabled": true,
    "locationContextEnabled": true
  }
},

nightwatch.conf.js.zip

i switch recently from 0.9.x version to 1.2.4 recently and i have also verified this page

https://github.com/nightwatchjs/nightwatch/wiki/Migrating-to-Nightwatch-1.0

phaseen commented 4 years ago

https://github.com/nightwatchjs/nightwatch/issues/1926 i also see similar issue in chrome and ie11.

in this case i have 4 windows opened switching between them give this error?

Error: Error while running "window" command: "Error: POST requests to /window must include a name parameter also. " at new Promise () at process._tickCallback (internal/process/next_tick.js:68:7)

FAILED: 1 errors and 64 passed (47.603s) Error: Error while running "window" command: "Error: POST requests to /window must include a name parameter also. " at new Promise () at process._tickCallback (internal/process/next_tick.js:68:7)


phaseen commented 4 years ago

Any body looking into this issue? please let me know i am blocked with test on other browsers with switch windows...

tarheeldobe commented 4 years ago

I am also experiencing this issue on Firefox, but function is working in Edge:

Nighwatch: nightwatch v0.9.21 Selenium server: 3.14.0 Firefox: Firefox 69.0.2 (64-bit) geckodriver-v0.21.0-win64/geckodriver.exe

Edge: Edge16299/MicrosoftWebDriver.exe

Edge window handle id: 1048576-BrowserFrame-1 Firefox window handle id: 6442450955

stale[bot] commented 4 years ago

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.