Skip to content

To capture screenshot ,with desktop library mss, pyautogui is my requirement , when multithreading with pytest-xdist in UC mode #2469

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

You must be logged in to vote

These are the SeleniumBase methods available for saving a screenshot during tests:

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_file(selector, file_name, folder=None, overlay_text="")

There are example tests that use those, such as SeleniumBase/examples/test_save_screenshots.py.

Tests also automatically save a screenshot on failure to the ./latest_logs folder.

You can also have all tests save a screenshot at the end with this pytest command-line option: --screenshot.

For questions related to other repos, (such as pyautogui), please see those respective repos,…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@suredarv06
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
3 participants