How to take a screen shot of the selected area on the screen – UiPath

There are lot of situations during the process execution where we have to take the screenshots, they can be used to convey some information or while trouble shooting the issues.

To achieve this, UiPath has an inbuilt activity “Take Screenshot” activity in UiPath.Core.Activities. This activity can be used to take screenshot at runtime.

let’s see how to do that…!!!

Example

Implementation using UiPath :

Step 1:
Drag “Take Screenshot” activity into the designer panel and provide the required inputs using properties panel.

Inputs :
Selector: The window that your trying the take the screenshot of.
ClippingRegion: Here you can define the clipping region by using left,right,bottom and top directions.

Output :
The output can be store in an image variable, to proceed further.


Step 2:
Drag “Save Image” activity into the designer panel to save the above captured image to specific location.

The parameters passed to this activity is the path of the file where you want to save the file and the variable (Image type) which is the result above activity.

Screenshot can be saved as a “png” or “jpg” file.


Note:

In case you want to take the screenshot of a image that is in the middle of the screen or appears on scrolling down, you can keep scrolling down until that image appears as shown below in screenshot. I have used double hotkey (PgDn) to speed up the scrolling. Once the output of Image Exists turns true, take down the screenshot and save it using “Save Image” activity. Also, you can use “Text Exists” instead of “Image Exists” or something similar.


Click here to download the Source Code…

Hope it has helped you… 

Connect with Anmol Yadav on LinkedIn 🙂

Advertisements

Leave a Reply

%d bloggers like this: