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.79k stars 1.31k forks source link

Cannot interact with elements while using Microsoft Edge and Internet Explorer #2394

Closed robertcorman89 closed 3 years ago

robertcorman89 commented 4 years ago

I tried to write a test that can be run on five different browsers: Chrome, Firefox, Opera, Edge, and IE. So far, I managed to succeed with Chrome, Firefox, and Opera, but I encountered some problems with the last two of them, meaning that the Edge and IE browsers open when the test starts, but IE cannot execute .click() command while Edge cannot perform any of the Nightwatch actions. I want to mention that I tried different versions of edge, ie or selenium drivers, but I ended up with the ones added below, which are the latest stable versions released. Please see the details in the following lines:

My Nightwatch test

searchForNightwatch.js

```js module.exports = { sampleTest: function(browser) { var googleSearchScreen = browser.page.googleSearch(); googleSearchScreen .assert.title('Google') .waitForElementVisible('@searchBar') .setValue('@searchBar', "nightwatchjs") .click('@submitSearch') } } ```

Run with command

$ node nightwatch --env edge,ie

Verbose output

debug.log

```txt For Edge: Error while running .isElementDisplayed() protocol action: TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters at new ClientRequest (_http_client.js:151:13) edge at Object.request (http.js:46:10) edge at HttpRequest.createHttpRequest ... For IE: Response 500 POST /wd/hub/session/b06b1441-3597-4867-a949-94efe1b7e715/element/4473599b-41ca-4617-9999-3eb11d022cd3/click (365ms) ie { ie state: 'move target out of bounds', ie sessionId: null, ie value: { ie systemInformation: "...", ie message: 'Cannot click on element', ie error: [ ie "Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'", ie "System info: ...", ie 'Driver info: driver.version: unknown' ie ] ie }, ie status: 34 ie } ie Error while running .clickElement() protocol action: Cannot click on element TypeError: Error while trying to create HTTP request for "/wd/hub/session/84e00ed82465bcf54d01f3a7b44d7904/element/[object Object]/displayed": Request path contains unescaped characters at new ClientRequest (_http_client.js:151:13) at Object.request (http.js:46:10) at new Promise () ```

Configuration

nightwatch.json

```js { ... "selenium": { "start_process": true, "server_path": "lib/drivers/selenium-server-standalone-3.141.59.jar", "start_session": true, "log_path": "", "port": 4446, "cli_args": { "webdriver.ie.driver": "lib/drivers/IEDriverServer.exe", "webdriver.edge.driver": "lib/drivers/msedgedriver.exe", "webdriver.chrome.driver": "lib/drivers/chromedriver.exe", "webdriver.gecko.driver": "lib/drivers/geckodriver.exe", "webdriver.opera.driver": "lib/drivers/operadriver.exe" } }, "test_workers": { "enabled": false, "workers": "auto" }, "test_settings": { ... "ie": { "desiredCapabilities": { "browserName": "internet explorer", "javascriptEnabled": true, "acceptSslCerts": true, "nativeEvents": false, "enablePersistentHover": true } }, "edge": { "desiredCapabilities": { "browserName": "MicrosoftEdge", "javascriptEnabled": true, "acceptSslCerts": true } } ... } } } ```

Environment

Executable Version
nightwatch --version v1.3.4
npm --version 6.14.4
yarn --version -
node --version v14.0.0
Browser driver Version
NAME VERSION
IEDriverServer 3.150.1.0
msedgedriver v81.0.416.64
selenium-server 3.141.59
OS Version
NAME VERSION
Windows 10 1909
KapustinMaxim commented 4 years ago

have some problem https://stackoverflow.com/questions/62715496/error-while-running-waitforelementvisible-command-for-microsoft-edge-on-nightw

KapustinMaxim commented 4 years ago

add in nightwatch.json w3c false option

edge: {
      desiredCapabilities: {
        browserName: 'MicrosoftEdge',
        javascriptEnabled: true,
        acceptSslCerts: true,
         edgeOptions:{
          w3c: false,
        }
      }
    },
stale[bot] commented 3 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.