Currently, I am conducting Selenium tests on Safari 6. I am utilizing the JavaScript executor to determine the viewport height.
public static String scrollHeightCommand = return document.documentElement.clientHeight;
initialHeight = ((Long) (jsx.executeScript(scrollHeightCommand)))
However, an exception is being thrown:
org.openqa.selenium.WebDriverException: 'undefined' is not a function (evaluating 'this.each(function(value, index) {
results.push(iterator(value, index));
})') (WARNING: The server did not provide any stacktrace information)
Interestingly, when I manually run the JavaScript command in the Safari console, it successfully returns the value of the viewport height. Can someone please help me identify the issue here?