To capture screenshot ,with desktop library mss, pyautogui is my requirement , when multithreading with pytest-xdist in UC mode #2469
-
I need a help , when multithreading with pytest-xdist , I need to capture the screenshot. In that case multiple chrome windows are opened , I need to capture screenshot of every window separately. How to achieve the scenario Exactly , Is there any way to pass driver.window_handles to above libraries to capture screen ? In multithreading every driver is a different instance I think ,then How to handle multiple windows? Please share your idea. Library mss, pyautogui ,I prefer for capturing screenshot You may be advice to take screenshot with seleniumbase(Browser Screenshot) , but My scenario is to capture screenshot from desktop (My screenshot should include all data from desktop too ,that why I am going for it) Thanks for reading, Is any ides please share with me |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
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 You can also have all tests save a screenshot at the end with this For questions related to other repos, (such as |
Beta Was this translation helpful? Give feedback.
These are the SeleniumBase methods available for saving a screenshot during tests:
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,…