Closed jtheodore-rent closed 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?
@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.
Could you post a log using the v0.9.21 version?
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)
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?
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.
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-
Thanks - I'll try that, appreciate you taking the time to help with this.
No problem, Just so you know, I haven't tried it myself. The es6 async is still quite new and not very polished yet.
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
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:
Below is the verbose output for the above code running on an IE11 VM:
This is our relevant configuration info for connecting to IE11 on Saucelabs: