How to Capture Full-Page Screenshots in SeleniumBase? #3362
-
I'm currently using SeleniumBase for my automated tests, and I need to capture full-page screenshots of the pages I'm testing. However, whenever I use
Any advice or solution would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
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
Methods called directly from the |
Beta Was this translation helpful? Give feedback.
Set the window size before taking the screenshot if the current size isn't good enough:
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…