You can retrieve a value from a desktop element using Get_Desktop_Value command. Here is a scenario that demonstrates how the command operates:
Usage Scenario: Suppose we have a .docx document as below that contains 8 random lines determined by a prefix ‘Line number:’ and we want to get the content next to the 5th line and store it in a variable.
Procedure: Define steps that lead up to the point where the document is opened. Then use Get_Desktop_Value command, enter a variable name, select “Text Recognition” as Read Type and select “Text” as Result Type. The reference point in this command is “Line 5:”, so we will need to define a Desktop Locator for this text only. Once a Desktop Locator is defined, we will need to determine how to move from “Line 5:” to the text next to it using Offset points and extend the region dimensions using Extension field. For the purpose of this example, we used 60 horizontal offset points ( X ) and 600 extension points to the right. The step will look as below:
Tip: Read Types:
A- Text Recognition: This type uses OCR to read the text and assign it to a variable name
B- Clipboard: This type copies the text value to your clipboard and assigns it to a variable, but only works with input fields, not labels.
The following video demonstrates how this step gets executed and the result is retrieved:
Comments
Please sign in to leave a comment.