Skip to content

getDocHeight() incorrectly returning viewport height for some applications #66

@roboaks

Description

@roboaks

I am using Chrome 79.0.3945.88 (64-bit) and Selenium WebDriver 3.141.59. When I use a public website like Google or Wikipedia the WHOLE_PAGE strategy works fine. I can see the page scrolling and the screenshot reflects that,

Using a proprietary application (Guidewire PolicyCenter, a major insurance system vendor), however, it doesn’t work. I’ve done some tracing and discovered the exact issue: com.assertthat.selenium_shutterbug.utils.web.Browser.getDocHeight() always returns the same value as com.assertthat.selenium_shutterbug.utils.web.Browser.getViewportHeight(). In short, the called JavaScript,

return Math.max(document.body.scrollHeight, document.body.offsetHeight, 
document.documentElement.clientHeight, document.documentElement.scrollHeight, 
document.documentElement.offsetHeight);

Simply returns the viewport height.

I don’t have any knowledge of the web UI framework that PolicyCenter uses and, unfortunately, I can’t provide access to PolicyCenter, as we use it over a VPN.

Have you ever seen anything like this before? Do you have any suggestions?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions