How to take a screenshot of the selected region on the screen and how to take a screenshot of the entire screen?
UiPath has an inbuilt activity “Take Screenshot” activity in UiPath.Core.Activities (~which is now a part of Uipath.System.Activities). This Take Screenshot activity can be used to take a screenshot of a specified UI element.
Steps mentioned below:
- Create a sample process and ensure to install Uipath.System.Activities from Manage packages.
- From the Activities pane, search for 'Take Screenshot' activity and drag the same into the designer pane.
- Set the required Target (Input) in the Properties pane.
- Selector: The target window.
- ClippingRegion (Keep this field blank if a screenshot of the entire screen is needed): Defines the clipping rectangle, in pixels, relative to the UiElement, in the following directions: left, top, right, bottom. It supports both positive and negative numbers.
- Set the required Output parameter from the Properties pane.
- Screenshot: The resulted screenshot. The field supports only Image variables.
- To save the taken screenshot, drag “Save Image” activity into the designer pane to save the screenshot to the specified location.
File Name: The full file path where you want to save the image, and its name. The screenshot can be saved as a “png” or “jpg” file.