Closed roboaks closed 4 years ago
Hi @roboaks
Thank you for reporting.
The issue with shootElement is now fixed in v1.2. Shutterbug wont switch to default content after taking element screenshot.
The issue with frame screenshot you are seeing is due to you are switching to the frame before taking screenshot. Shutterbug needs driver to be switched to default content before taking screenshot, e.g.
driver.switchTo().defaultContent();
Shutterbug.shootFrame(driver, "frameID", CaptureElement.VIEWPORT).save();
I've added related note to README.
Thanks, Glib
Thank you so much for the swift response Glib!
We will test things out today and let you know if we have any issues.
This fix worked perfectly. Furthermore, we took the simplest approach to shooting the popup, which is to simply take a viewport screenshot of the main window (which includes the popup); it worked perfectly.
Thanks again Glib :-)
Hi Rob, Great news! Thanks for feedback!
Here's the scenario. We are calling the new
shootElement
method passing aWebElement
that corresponds to a scrollablediv
i n the main window. Support for this usage is now built into our AFT framework and it works fine except if...iframe
-based popup to be displayediframe
shootElement
using the usual parametersWhat seems to happen is that ShutterBug uses Selenium to switch back to the main window to execute
shootElement
. Then when the AFT proceeds, it fails because the popupiframe
is no longer active. Is it indeed possible that ShutterBug uses Selenium to switch back to the main window?What I tried next was to change the ShutterBug config on the fly (our framework supports that) so that
shootFrame
is called, supplying theiframe
WebElement
and using theVIEWPORT
strategy (since we don't need to scroll the popup). This generates:I suspect that ShutterBug doesn't like the
VIEWPORT
strategy for a frame. Since the frame popup is small and will always be in view, I suppose I could just use the ShutterBugshootPage
method.Thoughts?