selenium-shutterbug icon indicating copy to clipboard operation
selenium-shutterbug copied to clipboard

Doesn't make a proper whole page screenshot of the page with a modal or a popup

Open plagov opened this issue 3 years ago • 2 comments

I used to use version 0.9.3 of the selenium-shutterbug. I did the whole page screenshot as follows:

Shutterbug.shootPage(webDriver, ScrollStrategy.WHOLE_PAGE).withName(name).save(path)

Recently, I have updated the dependency to version 1.5. The above code didn't compile, so I changed it to this:

Shutterbug.shootPage(webDriver, Capture.FULL).withName(name).save(path)

I noticed that with the updated version, it doesn't make a proper whole page screenshot if there's a modal window or a popup on the page. This modal is shown multiple times and the page looks very weird. Reverted back to 0.9.3.

plagov avatar Jan 04 '22 15:01 plagov

Hi @plagov ,

Have you got a reproducible example so we can debug?

Thanks Glib

glibas avatar Apr 04 '22 15:04 glibas

Hi @glibas,

It looks like this issue is partially solved. So, here's what I did. I found a public website with a React modal (at my working project the web app I'm testing is also using React). I wrote a basic test that opens a modal window and makes two screenshots - with Capture.FULL and Capture.FULL_SCROLL strategies.

So, with v1.6 of the selenium-shutterbug, the Capture.FULL strategy works fine and as expected. The other one (Capture.FULL_SCROLL) doesn't make a proper screenshot. Here's the code you can run and see how both look - https://github.com/plagov/shutterbug-screenshot-reproduce

I also checked my working project and Capture.FULL with v1.6 also does a proper screenshot with a modal. I will check throughout the week how it works with sticky headers, alert tooltips and similar floating elements.

So, it seems the Capture.FULL works fine with Chrome and Capture.FULL_SCROLL doesn't make a proper screenshot.

Let me know if you need an additional input from my side or any help!

plagov avatar Apr 04 '22 18:04 plagov