My goal is to verify the correct scroll position in the browser using NightwatchJS and Selenium. Below is the command I am using in Nightwatch:
assertScrollPosition(testValue) {
this.api.execute(() => {
const offsetValue = window.pageYOffset;
return offsetValue;
}, [], (result) => {
console.log(result);
this.assert.equal(
testValue,
result.value,
);
});
},
Initially, everything was working fine with this test. However, something changed recently and now the result
object is throwing an error:
{ status: -1,
value:
{ additionalInformation: '\nDriver info: org.openqa.selenium.chrome.ChromeDriver\nCapabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, ...chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]\nSession ID: 56606c23e68c130649c1efa3573c3122',
localizedMessage: 'unknown error: cov_1qa0joknhz is not defined\n (Session info: chrome=66.0.3359.117)\n (Driver info: chromedriver=2.36.540469 (1881fd7f8641508feb5166b7cae561d87723cfa8),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 9 milliseconds\nBuild info: version: \'2.53.0\', revision: \'35ae25b\', time: \'2016-03-15 17:00:58\'\nSystem ...
...