Skip to content

How to Capture Full-Page Screenshots in SeleniumBase? #3362

Answered by mdmintz
dsmabulage asked this question in Q&A
Discussion options

You must be logged in to vote

Set the window size before taking the screenshot if the current size isn't good enough:

driver.set_window_size(x, y)

If you're running tests in headless mode, the default starting size is larger than normal.

More info: #2469 (comment).

Useful examples:

The SeleniumBase formats have their own screenshot methods separate from the driver:

  • self.save_screenshot(name, folder=None, selector=None, by="css selector")
  • self.save_screenshot_to_logs(name=None, selector=None, by="css selector")
  • self.save_element_as_image_fil…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@dsmabulage
Comment options

@mdmintz
Comment options

@dsmabulage
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants