Skip to content

Fail to take regular element screenshot via Safari/Mac #105

Open

Description

@MohabMohie

When I use this line of code with safari

Shutterbug.shootElement(driver, elementLocator, CaptureElement.VIEWPORT, true);

the result is the below exception whereas I chose a VIEWPORT image that should have no scrolling

`java.lang.UnsupportedOperationException: Full scrollable element screenshot is supported in Chrome, Firefox and MicrosoftEdge browsers only.

at com.assertthat.selenium_shutterbug.utils.web.Browser.takeFullPageElementScreenshot(Browser.java:184)
at com.assertthat.selenium_shutterbug.utils.web.Browser.takeElementViewportScreenshot(Browser.java:657)
at com.assertthat.selenium_shutterbug.core.Shutterbug.shootElement(Shutterbug.java:295)`

the issue is traced to this line of code

BufferedImage image = takeFullPageElementScreenshot();

which should be changed to

BufferedImage image = takeScreenshot();

Activity

  1. self-assigned this
    on Jun 21, 2022
  2. MohabMohie commented on Apr 10, 2024

    @MohabMohie
    Author

    @glibas any news about this issue my friend?

  3. glibas commented on Apr 10, 2024

    @glibas
    Member

    Hi @MohabMohie ,

    If following your suggesting of changing

    BufferedImage image = takeFullPageElementScreenshot();

    which should be changed to

    BufferedImage image = takeScreenshot();

    this will result in incorrect behaviour as takeScreenshot(); won't take the element screenshot which is passed as elementLocator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions