-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 ?
It is also to consider we are in UC mode and in multithreading.
In multithreading every driver is a different instance I think ,then How to handle multiple windows?
Please share your idea.
Is there any special libraries available to achieve capturing screenshot from desktop with the help of seleniumbase ?
Or seleniumbase is itself has any api to achieve it ?
Or Is there any reference for opened windows in multithreading which shall be passed to libraries to take screenshot?
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.
All reactions
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
-
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, or ask on StackOverflow.
Beta Was this translation helpful? Give feedback.
All reactions
-
Ok, Thanks for reply
Beta Was this translation helpful? Give feedback.
All reactions
-
Is there a way to take full screenshot
Beta Was this translation helpful? Give feedback.
All reactions
-
See #3362 (comment)
Beta Was this translation helpful? Give feedback.