Get Number

A Get number building block gets a number on the whole screen or part of the screen. Formatting and filtering rules can be applied so that for instance only numbers which are formatted as “Price: [NUMBER] USD” and which are less than or equal to 1,500 are retrieved. See the Use Numbers and Variables and Capture text on screen lessons for examples of how this works.

Fully expanded, the Get number block shows the following properties:

get number

The Block Header (“Get number”)

The green input connector in the header is used to trigger the block to start executing.

The green output connector in the header triggers when the number has been retrieved. If “All occurrences” of the “Use occur.” property is selected (see below), this output connector triggers on each iteration until all occurrences are iterated through.

The title of the block (“Get number”) can be changed by double-clicking on it and typing in a new title.

Area

An area of the screen where the number will be searched for in X, Y, Width, Height coordinates, starting with the upper-leftmost pixel. The top-left corner of the screen is position 0, 0. If no area is defined, the entire screen is searched.

It’s possible to enter the area values manually, but the area can also be captured by right-clicking the property and selecting “Capture area”.

Click the expander button to work with the area’s position and size and their nested sub-properties separately.

Number found

The number that was retrieved from the screen, subject to the optional formatting and filtering settings (see below).

Language

Select the language in which you want to find the text.

Not Found

This green output connector triggers if a number is not found before the timeout, subject to the optional formatting and filtering settings (see below). This is typically used to branch execution flow or to explicitly fail a case by linking it to a Fail block.

Position found

The screen position where the number was found in X, Y coordinates. The top-left corner of the screen is position 0, 0.

Note that this position is the middle of the number retrieved, not the upper-leftmost pixel of the text.

Click the expander button to work with the X and Y coordinates separately.

Area found

The screen area where the number was found in X, Y, Width, Height coordinates, starting with the upper-leftmost pixel. The top-left corner of the screen is position 0, 0.

Click the expander button to work with the area’s position and size and their nested sub-properties separately.

Find format

Define a format that the number must meet to be retrieved. For instance, by defining “Price: [NUMBER] USD” only numbers inside text such as “Price: 123.00 USD” will be retrieved.

1000 separator

Define the character used to separate 1000s in the number. The default value will be that set on Studio’s regional settings in Windows — typically “,” or “.”.

Decimal separator

Define the character used to separate decimals in the number. The default value will be that set on Studio’s regional settings in Windows — typically “,” or “.”.

Is case sensitive

Select whether the number recognition should be case sensitive. By default, it is case insensitive.

Engine

User can select 'Default' as LEAPWORK OCR text recognition engine or user can opt for 'ABBYY' as text recognition engine.

OCR Mode

User can opt for "Full mode" or "Fast Speed" OCR mode.

Full mode: In full mode our OCR perform four recognition tries in parallel using two different modes i.e. two in normal and two in inverted colors.

Fast Speed:  In fast mode our OCR perform two recognition tries in parallel one in normal and other in inverted colors.

OCR Precision

OCR precision sets the accuracy of the OCR results on a character level. This means, a higher OCR precision level requires a higher confidence in the OCR engine before a certain character is matched.

With a high precision you can be very confident that the characters found are the correct characters.

On the other side a high precision can result in that some characters are not found. Setting a lower precision means that in general more characters are found, but the assurance that it’s the right characters is lower than with a high precision. So, the right setting is a balance between finding all the right characters and not include too much that ruins the result, and will depends on the font, colors, background, size of the text.

Precision Levels are:

  1. High: This is the highest Confidence factor or precision which user are sure that the character is large and visible enough (not hazy or compacted) to be recognized by an OCR engine. The predefined value is 70.
  2. Medium: This is the medium Confidence factor which user can opt when they think the character may or may not be recognized by an OCR engine, so they set this. This tells engine to search look for the possible characters in the defined area. The predefined value is 50.
  3. Low: This is the Low Confidence factor which user can opt when they are less sure that the character can be recognized by an OCR engine, so they set this. This tells engine to search for relatively possible characters in and outside the dictionary in the defined area where the precision to identify is low. The predefined value is 30.
  4. Very Low: This is the Lowest Confidence factor which user can opt when they are least sure that the character can be recognized by an OCR engine, so they set this. This tells engine to search for relatively all possible characters in and outside the dictionary in the defined area where the precision to identify is least. The predefined value is 20.
  5. Custom: This can be used to set the custom Precision value/Confidence factor. It is ranging from 0-100.

Zero will return everything what was recognized by OCR and 100 will return the best possible recognized result. 
In case the built-in OCR engine in LEAPWORK is not matching the requirements, it is possible to change the engine to ABBYY. ABBYY is the world leading vendor of OCR engines and perform second-to-one when it comes to OCR. Contact our [Customer Success, link to chat page] team to get started with ABBYY.

Use dirty edge mode

Check this checkbox if the number is placed on top of a textured background or is close to a visual border element. This instructs the text recognition engine to use a special mode to compensate for such backgrounds and borders.

It should be noted that no text recognition engine is perfect. If you experience problems with text recognition, try zooming in on the content. Larger letters are typically easier to recognize.

Filter

Define a filter that the number must meet to be retrieved. For instance, only retrieve numbers that are “Greater than” 100.

Filter value

The value used by the filter.

Use Occurrence

Select which occurrence of the number on screen to use, if more than one is found.

Select “All” to iterate through all of the occurrences. By selecting “All”, the sub-properties Current index and Completed are shown (see below).

Current index

The current index when iterating through all occurrences of the number on screen. For instance, if three occurrences are found, this property will contain 1 for the first one, then 2 for the second and finally 3 for the last one.

Completed

This green output connector triggers when the iteration of all occurrences are completed.

Timeout

The maximum time spent searching for the number before giving up and triggering “Not found” (see above).

The default value is 10 seconds.

Note: All cases have a “global timeout” that can be configured in the “Settings” panel. This is unrelated to the timeout of a single building block. However, a running case will automatically be cancelled if it runs for longer than the global timeout.

Scroll to find

When a value other than “None” is selected, the building block will use scrolling when searching for the number. This can be useful when searching in scrollable content such as web pages and documents.

Max repeats

The maximum number of times to perform a scroll before giving up searching for the number.

Amount

The amount of scrolling that will be performed on each scroll repeat.

Delay (sec)

The delay in seconds between each of the scroll amounts.

Await no movement

Delay the search for number until there has been no movement on the screen for a specific period of time — for instance 2 seconds.

This is useful when waiting for a screen update to occur, for instance a page loading in a browser window. Regardless of this checkbox, the search will occur after waiting a maximum of 30 seconds.

Await Timeout

The number of seconds the screen must have seen no movement before proceeding.

 

Updated February 2nd 2017.