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

getLocationInView doesn't work on IE11 on version 1.0.19 #2088

Closed jtheodore-rent closed 5 years ago

jtheodore-rent commented 5 years ago

I am in the process of upgrading from nightwatch to 1.0.19 from 0.9.21. Most of the issues we have run into we have been able to resolve, but there is a persistent issue with getLocationInView on IE11 that I am unable to resolve sufficiently.

Nightwatch version: 1.0.19 Node version: 11.9.0

Below is sample test code that will work on a chrome browser in saucelabs but fail on Internet Explorer 11:

const pdpPath = '/apartments/Georgia/Atlanta/Post-Brookhaven/192087/'

module.exports = {
  before: browser => {
    browser
      .url(`https://www.apartmentguide.com${pdpPath}`)
  },

  after: browser => {
    browser.end()
  },

  'Scroll far down the page': browser => {
    browser.scrollByAmount(0, 1000000)
  },

  'Open Modal': browser => {
    const pdp = browser.page.large.pdp()
    browser.pause(1000).page.large.pdp()
      .getLocationInView('@floorplansSection', () => {
        pdp.section.floorplans.click('@firstFloorplan', () => {
          pdp.waitForElementVisible('@floorplanModal')
        })
      })
  },

}

Below is the verbose output for the above code running on an IE11 VM:

[Large/Pdp/Sample Test] Test Suite
==================================
   Request POST http://ondemand.saucelabs.com /wd/hub/session
   { desiredCapabilities:
      { browserName: 'internet explorer',
        acceptSslCerts: true,
        platform: 'Windows 10',
        autoAcceptAlerts: true,
        javascriptEnabled: true,
        avoidProxy: true,
        build: 'Build: ${BUILD_NUMBER} Branch: ${BRANCH_NAME}',
        version: '11.103',
        screenResolution: '1920x1080',
        elementScrollBehavior: 1,
        recordMp4: true,
        name: 'Large/Pdp/Sample Test' } }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session (15649ms)
   { status: 0,
     state: null,
     value:
      { takesScreenshot: true,
        version: '11',
        'ie.forceShellWindowsApi': false,
        unexpectedAlertBehaviour: 'dismiss',
        'ie.browserCommandLineSwitches': '',
        browserAttachTimeout: 0,
        'ie.ensureCleanSession': false,
        ignoreProtectedModeSettings: false,
        platform: 'WINDOWS',
        'webdriver.remote.sessionid': 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
        ignoreZoomSetting: false,
        nativeEvents: true,
        'ie.enableFullPageScreenshot': true,
        javascriptEnabled: true,
        requireWindowFocus: false,
        browserName: 'internet explorer',
        hasMetadata: true,
        initialBrowserUrl: 'about:blank',
        enableElementCacheCleanup: true,
        cssSelectorsEnabled: true,
        'ie.fileUploadDialogTimeout': 3000,
        elementScrollBehavior: 1,
        enablePersistentHover: true,
        pageLoadStrategy: 'normal',
        'ie.forceCreateProcessApi': false },
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb' }
 Received session with ID: b6ce3eebb674414eaa4f2eb9c1a91ecb

 → Running [before]:

 → Running command: url ('https://www.apartmentguide.com/apartments/Georgia/Atlanta/Post-Brookhaven/192087/')
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/url
   { url:
      'https://www.apartmentguide.com/apartments/Georgia/Atlanta/Post-Brookhaven/192087/' }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/url (9633ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: null,
     state: 'success' }
 → Completed command url ('https://www.apartmentguide.com/apartments/Georgia/Atlanta/Post-Brookhaven/192087/') (9635ms)
 → Completed [before].
Running:  Scroll far down the page

 → Running [beforeEach]:
 → Completed [beforeEach].

 → Running command: scrollByAmount (0, 1000000)

 → Running command: execute ([Function], {0, 1, [Function])
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/execute
   { script:
      'var passedArgs = Array.prototype.slice.call(arguments,0); return function(xValue, yValue) {\n    window.scrollBy(xValue, yValue)\n  }.apply(window, passedArgs);',
     args: [ 0, 1000000 ] }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/execute (1409ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: null,
     state: 'success' }
 → Completed command execute ([Function], {0, 1, [Function]) (1410ms)
 → Completed command scrollByAmount (0, 1000000) (1413ms)
 → Running [afterEach]:
 → Completed [afterEach].
No assertions ran.
Running:  Open Modal

 → Running [beforeEach]:
 → Completed [beforeEach].

 → Running command: pause (1000)
 → Completed command pause (1000) (1001ms)

 → Running command: getLocationInView ({name, __index, selector, locateStrategy, parent, [Function])
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element
   { using: 'css selector',
     value: '[data-tid=floorplans-and-pricing]' }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element (525ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: { ELEMENT: '0' },
     state: 'success' }
   Request GET http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/location_in_view
   Response 500 GET http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/location_in_view (646ms)
   { status: 13,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value:
      { systemInformation:
         "System info: host: 'sauce-win10', ip: '172.20.44.151', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'",
        message:
         'Unable to get element location. (WARNING: The server did not provide any stacktrace information)',
        error:
         [ 'Command duration or timeout: 297 milliseconds',
           "Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'",
           "System info: host: 'sauce-win10', ip: '172.20.44.151', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'",
           'Driver info: org.openqa.selenium.ie.InternetExplorerDriver',
           'Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=1, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]',
           'Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXef098a00' ] },
     state: 'unhandled error' }
 Error while running .isElementLocationInView() protocol action: Unable to get element location. (WARNING: The server did not provide any stacktrace information)

   An error occurred while running .getLocationInView() command on <Element [name=@floorplansSection]>: Unable to get element location. (WARNING: The server did not provide any stacktrace information)
       at processTicksAndRejections (internal/process/next_tick.js:81:5)
 → Completed command getLocationInView ({name, __index, selector, locateStrategy, parent, [Function]) (1183ms)

 → Running command: click ({name, __index, selector, locateStrategy, parent, [Function])
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element
   { using: 'css selector',
     value: '[data-tid=floorplans-and-pricing]' }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element (476ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: { ELEMENT: '0' },
     state: 'success' }
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/elements
   { using: 'xpath',
     value: "(//div[@data-tid='floorplan-row'])[1]" }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/elements (364ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: [ { ELEMENT: '1' } ],
     state: 'success' }
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/1/click

   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/1/click (1669ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: null,
     state: 'success' }
 → Completed command click ({name, __index, selector, locateStrategy, parent, [Function]) (2517ms)

 → Running command: waitForElementVisible ({name, __index, selector, locateStrategy, parent)
   Request POST http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/elements
   { using: 'css selector', value: '[data-tid=floorplan-modal]' }
   Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/elements (1906ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: [ { ELEMENT: '2' } ],
     state: 'success' }
   Request GET http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/2/displayed
   Response 200 GET http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/2/displayed (326ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: true,
     state: 'success' }
✔ Element <[data-tid=floorplan-modal]> was visible after 2233 milliseconds.
 → Completed command waitForElementVisible ({name, __index, selector, locateStrategy, parent) (2235ms)
 → Running [afterEach]:
 → Completed [afterEach].

FAILED: 1 errors and  1 passed (7.192s)
 → Running [after]:

 → Running command: end ()

 → Running command: session ('delete', [Function])
   Request DELETE http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb
   Response 200 DELETE http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb (364ms)
   { status: 0,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value: '' }
 → Completed command end () (366ms)
 → Completed command session ('delete', [Function]) (366ms)
 → Completed [after].
_________________________________________________

TEST FAILURE: 1 error during execution 0 assertions failed, 1 passed. 34.371s

 ✖ large/pdp/sampleTest
 – Open Modal (7.192s)

  An error occurred while running .getLocationInView() command on <Element [name=@floorplansSection]>: Unable to get element location. (WARNING: The server did not provide any stacktrace information)
       at processTicksAndRejections (internal/process/next_tick.js:81:5)

This is our relevant configuration info for connecting to IE11 on Saucelabs:

"saucelabs_win10_ie11": {
      "selenium": {
        "host": "ondemand.saucelabs.com",
        "port": 80
      },
      "request_timeout_options": {
        "timeout": 900000
      },
      "globals": {
        "waitForConditionTimeout": 60000,
        "waitForConditionPollInterval": 100
      },
      "desiredCapabilities": {
        "browserName": "internet explorer",
        "version": "11.103",
        "platform": "Windows 10",
        "javascriptEnabled": true,
        "screenResolution": "1920x1080",
        "elementScrollBehavior": 1,
        "recordMp4": true
      }
    }
beatfactor commented 5 years ago

Well the error is pretty clear:

Request GET http://ondemand.saucelabs.com /wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/location_in_view
   Response 500 GET http://ondemand.saucelabs.com/wd/hub/session/b6ce3eebb674414eaa4f2eb9c1a91ecb/element/0/location_in_view (646ms)
   { status: 13,
     sessionId: 'b6ce3eebb674414eaa4f2eb9c1a91ecb',
     value:
      { systemInformation:
         "System info: host: 'sauce-win10', ip: '172.20.44.151', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'",
        message:
         'Unable to get element location. (WARNING: The server did not provide any stacktrace information)',
        error:
         [ 'Command duration or timeout: 297 milliseconds',
           "Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'",
           "System info: host: 'sauce-win10', ip: '172.20.44.151', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'",
           'Driver info: org.openqa.selenium.ie.InternetExplorerDriver',
           'Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=1, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]',
           'Session ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXef098a00' ] },
     state: 'unhandled error' }
 Error while running .isElementLocationInView() protocol action: Unable to get element location. (WARNING: The server did not provide any stacktrace information)

It doesn't look like this can be fixed in Nightwatch. Feel free to post on the Mailing List for assistance, or maybe you could contact SauceLabs support to check why is that command timing out?

jtheodore-rent commented 5 years ago

@beatfactor this issue was introduced by Nightwatch with the new version - it didn't occur on the old version. The element is there. For some reason, the new version of nightwatch is having difficulty determining the location of elements that are not yet scrolled into view on IE11, which kind of defeats the purpose of the getLocationInView command.

beatfactor commented 5 years ago

Could you post a log using the v0.9.21 version?

jtheodore-rent commented 5 years ago
Running:  Scroll far down the page
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session
 - data:  {"desiredCapabilities":{"browserName":"internet explorer","javascriptEnabled":true,"acceptSslCerts":true,"platform":"Windows 10","version":"11.103","screenResolution":"1920x1080","elementScrollBehavior":1,"recordMp4":true,"autoAcceptAlerts":true,"avoidProxy":true,"build":"Build: ${BUILD_NUMBER} Branch: ${BRANCH_NAME}","name":"Large / Test IE11"}}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":348,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session (12456ms) { status: 0,
  state: null,
  value:
   { takesScreenshot: true,
     version: '11',
     'ie.forceShellWindowsApi': false,
     unexpectedAlertBehaviour: 'dismiss',
     'ie.browserCommandLineSwitches': '',
     browserAttachTimeout: 0,
     'ie.ensureCleanSession': false,
     ignoreProtectedModeSettings: false,
     platform: 'WINDOWS',
     'webdriver.remote.sessionid': '55fd1992a87e44c99a0f43b23503bd08',
     ignoreZoomSetting: false,
     nativeEvents: true,
     'ie.enableFullPageScreenshot': true,
     javascriptEnabled: true,
     requireWindowFocus: false,
     browserName: 'internet explorer',
     hasMetadata: true,
     initialBrowserUrl: 'about:blank',
     enableElementCacheCleanup: true,
     cssSelectorsEnabled: true,
     'ie.fileUploadDialogTimeout': 3000,
     elementScrollBehavior: 1,
     enablePersistentHover: true,
     pageLoadStrategy: 'normal',
     'ie.forceCreateProcessApi': false },
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  hCode: 360139286,
  class: 'org.openqa.selenium.remote.Response' }
INFO Got sessionId from selenium 55fd1992a87e44c99a0f43b23503bd08
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/url
 - data:  {"url":"https://www.apartmentguide.com/apartments/Georgia/Atlanta/Post-Brookhaven/192087/"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":91,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/url (7872ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: null,
  state: 'success',
  hCode: 19887324,
  class: 'org.openqa.selenium.remote.Response' }
LOG     → Completed command url (7873 ms)
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/execute
 - data:  {"script":"var passedArgs = Array.prototype.slice.call(arguments,0); return function(xValue, yValue) {\n    window.scrollBy(xValue, yValue)\n  }.apply(window, passedArgs);","args":[0,1000000]}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":192,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/execute (675ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: null,
  state: 'success',
  hCode: 1601605575,
  class: 'org.openqa.selenium.remote.Response' }
LOG     → Completed command execute (677 ms)
INFO FINISHED
No assertions ran.

Running:  Open Modal
LOG     → Completed command pause (1004 ms)
LOG     → Completed command useCss (1 ms)
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element
 - data:  {"using":"css selector","value":"[data-tid=floorplans-and-pricing]"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":68,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element (626ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: { ELEMENT: '0' },
  state: 'success',
  hCode: 1195530950,
  class: 'org.openqa.selenium.remote.Response' }
INFO Request: GET http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/0/location_in_view
 - data:
 - headers:  {"Accept":"application/json","Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
ERROR Response 500 GET http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/0/location_in_view (554ms) { status: 13,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value:
   { hCode: 1061728604,
     suppressed: [],
     additionalInformation:
      '\nDriver info: org.openqa.selenium.ie.InternetExplorerDriver\nCapabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=1, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]\nSession ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXX53286594',
     localizedMessage:
      "Unable to get element location. (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 266 milliseconds\nBuild info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'\nSystem info: host: 'sauce-win10', ip: '172.20.113.33', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'\nDriver info: org.openqa.selenium.ie.InternetExplorerDriver\nCapabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=1, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]\nSession ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXX53286594",
     class: 'org.openqa.selenium.WebDriverException',
     buildInformation:
      { buildRevision: 'a36b8b1',
        releaseLabel: '2.53.1',
        hCode: 1700639155,
        buildTime: '2016-06-30 17:37:03',
        class: 'org.openqa.selenium.internal.BuildInfo' },
     message:
      "Unable to get element location. (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 266 milliseconds\nBuild info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'\nSystem info: host: 'sauce-win10', ip: '172.20.113.33', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'\nDriver info: org.openqa.selenium.ie.InternetExplorerDriver\nCapabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=1, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=about:blank, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]\nSession ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXX53286594",
     systemInformation:
      "System info: host: 'sauce-win10', ip: '172.20.113.33', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'",
     cause: null,
     supportUrl: null },
  state: 'unhandled error',
  hCode: 1728028016,
  class: 'org.openqa.selenium.remote.Response' }
LOG     → Completed command getLocationInView (1188 ms)
LOG     → Completed command useRecursion (0 ms)
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element
 - data:  {"using":"css selector","value":"[data-tid=floorplans-and-pricing]"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":68,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element (287ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: { ELEMENT: '0' },
  state: 'success',
  hCode: 258823408,
  class: 'org.openqa.selenium.remote.Response' }
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/0/element
 - data:  {"using":"xpath","value":"(//div[@data-tid='floorplan-row'])[1]"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":65,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/0/element (956ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: { ELEMENT: '1' },
  state: 'success',
  hCode: 490452236,
  class: 'org.openqa.selenium.remote.Response' }
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/1/click
 - data:
 - headers:  {"Content-Length":0,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/1/click (1376ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: null,
  state: 'success',
  hCode: 1776208010,
  class: 'org.openqa.selenium.remote.Response' }
LOG     → Completed command click (2623 ms)
LOG     → Completed command useCss (0 ms)
INFO Request: POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/elements
 - data:  {"using":"css selector","value":"[data-tid=floorplan-modal]"}
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":61,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 POST http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/elements (503ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: [ { ELEMENT: '2' } ],
  state: 'success',
  hCode: 507069219,
  class: 'org.openqa.selenium.remote.Response' }
INFO Request: GET http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/2/displayed
 - data:
 - headers:  {"Accept":"application/json","Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 GET http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08/element/2/displayed (862ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: true,
  state: 'success',
  hCode: 1936092324,
  class: 'org.openqa.selenium.remote.Response' }
 ✔ Element <[data-tid=floorplan-modal]> was visible after 1366 milliseconds.
LOG     → Completed command waitForElementVisible (1368 ms)
LOG     → Completed command useCss (0 ms)
LOG     → Completed command useCss (0 ms)
LOG     → Completed command useCss (0 ms)
INFO FINISHED

OK. 1 assertions passed. (6.349s)
INFO Request: DELETE http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08
 - data:
 - headers:  {"Content-Length":0,"Authorization":"Basic anRoZW9kb3JlOTk6ZTYwZDBhNjUtYWFkZC00Y2RiLWI0MTUtMGNhOTMxYmNiNGQ4"}
INFO Response 200 DELETE http://ondemand.saucelabs.com/wd/hub/session/55fd1992a87e44c99a0f43b23503bd08 (415ms) { status: 0,
  sessionId: '55fd1992a87e44c99a0f43b23503bd08',
  value: '' }
LOG     → Completed command end (417 ms)
LOG     → Completed command session (416 ms)

OK. 1  assertion passed. (27.888s)
beatfactor commented 5 years ago

So you have the same error there as well, but in v0.9.21 it wasn't taken into account, now it is. Have you tried with removing the getLocationInView altogether from the test?

jtheodore-rent commented 5 years ago

I have - without that, the test doesn't pass at all. Maybe that error should be a warning? When the error occurs, the test still continues past and succeeds all the actual assertions we have, but it gets marked as a failure because of this error.

beatfactor commented 5 years ago

You can try to catch the error - you'll need v1.1.8 or above:

Try this:

'Open Modal': async function(browser) {
    const pdp = browser.page.large.pdp()
    await browser.pause(1000);
    try {
      await pdp.getLocationInView('@floorplansSection');
    } catch (e) {
      console.warn(e.stack);
    }
    await pdp.section.floorplans.click('@firstFloorplan');
    await pdp.waitForElementVisible('@floorplanModal');
  },

More (not a lot) about ES6 async here: https://nightwatchjs.org/guide#using-es6-async-await-beta-

jtheodore-rent commented 5 years ago

Thanks - I'll try that, appreciate you taking the time to help with this.

beatfactor commented 5 years ago

No problem, Just so you know, I haven't tried it myself. The es6 async is still quite new and not very polished yet.

jtheodore-rent commented 5 years ago

Understood - I'm still working on cleaning up some of the other tests so we can actually get the new version of Nightwatch into our pipeline - once that's completed, I'll circle back to this