ELMA RPA > ELMA RPA Designer > Process modeling > Activities / Basic activity settings principles 

Basic activity settings principles

The settings of most activities are set automatically when recording the process:

You can change the settings if you need to.

The following activity settings can be set only manually:

To open the settings window, click on the activity on the process diagram. It will appear on the right side of the workspace. The window consists of two tabs: Parameters and Conditions.

Parameters Tab

The Parameters tab displays a set of parameters that can vary depending on the selected activity. These are the basic activity parameters, target parameters, and control parameters.

basic-activity-settings-1

Basic parameters

These parameters are set for all activities but may differ depending on the selected activity.

Target and control parameters

Recognizing interface elements is crucial for RPA. We can’t use the element unless we find it. Searching for interface elements is based on a set of features.

For example, for activities Click, Click Text, Hover, Drag&Drop, Scroll, Get Text, and Get OCR Text you need to specify target and control parameters.

Target Box

The Target box displays a screenshot of the interface element the action is performed on.

Here you can change a place for a click. To do this, click on the interface element screenshot and set the coordinates.

click coordinates

  1. Define the original cursor position. The offset coordinates for performing the action are calculated relative to it. There are several options available: Top left corner, Top right corner, Bottom right corner, Bottom left corner, and Center.
  2. Click the Set coordinates button and move the 63 icon to the required area on the screenshot.
  3. After that, X and Y offsets will be automatically set relative to the original cursor position (indicated by a yellow circle). You can set the coordinates manually. The value is specified in pixels. If the X and Y values are 0, there will be no offsets.

You can scale the element screenshot by the zoom slider.

To cancel the cursor offset, click the Reset button.

To save set offset coordinates, click the Save button.

You can set the following target parameters:

  • Search method — select the element search method: Native, By image, or OCR.

Search method

Description

Native

Searching for an interface element based on the information received from the operating system and secondary attributes. The user interface is presented as a structure. Its elements are hierarchically connected and each of them has particular features. Information about the structure allows searching for interface elements. The advantages of the method are speed and accuracy. You can use the elements and their data properties that are not displayed in the user interface.

But this method doesn’t always work. Native may not work with image search or because of the certain properties of the an interface element. For example, you cannot use this method during remote desktop streaming as the local machine has only videos and a number of images transmitted from the remote one.

By image

Searching for areas similar to the required one. The most suitable one will be selected. This method is used for image search, for example, icons. A 100% is not required, the search is focused on finding the closest match. That’s why the method can still be effective if the background of the image is changed. Search by image can be applied in those cases when the whole screen or a particular area is represented as a screenshot.

We recommend using the method when Native doesn’t work. Compared to Native, image search may take a longer time and be less accurate.

OCR (Optical Character Recognition)

The search is based on a picture and secondary attributes received from the system. The search defines areas containing text. If there is a match, its coordinates are provided.

There are two main ways to use OCR:

  • to obtain a text if there is a fixed or a set area;
  • to define the element position if there is a text to search for and a match is found.

In focus

Finds the element that obtains input focus and ignores other properties to find the interface element.

The selection of the search method depends on the activity. You can also combine the methods. We recommend using Native method or OCR in case the first cannot be applied.

  • Number of search attempts and interval (ms). Determine the number of attempts that the bot should make to find the selected interface element. The default value is 10. You can also set a pause between the bot attempts to find the required interface element. The timeout interval is set in milliseconds. The default value is 500. To edit the default values, click the 65 icon, enter the value and save it by clicking anywhere on the screen or using the 64 icon.
  • XPath path. A path to the web page element that is set using the XPath language. This parameter is used for identifying web elements. To recognize elements using the XPath, install the ELMA Web Recognizer extension. The link can be found in the designer settings. You can specify values of the context variables. Click on the add variables button icon and specify  the variable. You can select it from the list or create the new one by clicking Create parameter. The value is inserted as {$variable name}. You can fill in the field manually following the format. Read more about process context variables in the Process context article.

Examples of using XPath

Control Box

When you model a process, the recording mode automatically collects all the necessary information about the interface element (its distinctive features). This information is displayed in the Control box.

When a bot performs the process, it relies on these features to find the required element.

basic-activity-settings-3

  • Root element. The root element name (window name);
  • Name. Control name;
  • Type. Control type;
  • Text. The denoted text for OCR search;
  • Level. The level of control nesting starting from the desktop;
  • Ratio. The control sides ratio.
  • Index. The element index. The field is filled in when there are several similar elements in the interface.

If the activity has a subcontrol, then in this box you will see a subcontrol screenshot and the detailed information. It has the same distinctive features as a control. To delete a subcontrol, click the delete button icon.

To specify the information about a subcontrol manually, click Add element +.

Regular expressions

The control information can change. For example, the root element defines the window name that can change. The changes may affect a character, a word, or a full name.

Let’s take an example of clicking the button for buying a product. The root element value can vary depending on the context, so the name value displaying the cost will also change.

regular expressions

In these cases, you can use regular expressions. To learn more, go to Microsoft official site.

Initial value:

 $898 | 17.09 - 19.09, LUX ⇄ SSH - Google Chrome 

It can be converted to:

/[\d\s]+$ \| \d{2}\.\d{2} - \d{2}\.\d{2}, [A-Z]{3} ⇄ [A-Z]{3} - Google Chrome/

or:

/.*$ \| .* - .* ⇄ .* - Google Chrome/

In case it is assumed that other values won’t be found:

/.* - Google Chrome/

For the Name field you can use:

/Book for [\d\s]+$/

or:

/Book for .*/

Regular expressions can also be used in Insert from context and Get control data activities.

For these activities, you can set patterns that contain regular expressions and allow you to select a substring with a value from a string. The obtained value is then converted to the variable type responsive to the format.

Context variables

You can use context variables when setting activities. You can use context variable for the activities Click Text, Enter Text, Start Application, File, Assign Parameter and Log Message.

Moreover, you can add variables in the Control box, when filling in the Root element, Name, Type, and Text fields. Click the 65button and specify the variable. You can select is from the list or create the new one by clicking Create parameter. The value is inserted as {$variable name}. You can enter the name of the variable manually following this format. For example, {$username}@companyname.com. Read more about process context variables in the Process context article.

For example, set variables in the Root element field of the Control box.

Initial text:

 $898 | 17.09 - 19.09, LUX ⇄ SSH - Google Chrome

You can substitute the context variables values. Create the following variables: Cost, Start date, End date, Departure place codename, Arrival place codename. Insert them into the source text:

 {$cost}$ | {$date1} - {$date2}, {$from} ⇄ {$to} - Google Chrome

You can also use the add variables button button to add variables in activities Enter text, File, Assign parameter, and Log message.

The values of the context variables will be substituted during the process running.

Conditions Tab

Here you can set conditions and waiting time before and after the activity performance, and a message to log files.

conditions tab

Delay before and after activity

There is a pause before and after the activity performance that lasts for the time set in Delay before and Delay after fields. The waiting time is set in milliseconds, the default value is 250. Click the 26 button to change the time.

Conditions

Conditions are set in two blocks:

  • Pre-condition. This condition is checked before activity performance. If it is met, the bot performs the activity.
  • Post-condition. This condition is checked after activity performance. If it met, the bot moves to the next activity.

The process will not move further unless the conditions are met. When you set activity conditions, you have to create an escalation for directing the process to another transition in case of errors. Read more about escalation in the Creating escalation section of the Execution flow article.

You can use several conditions at once.

To add a condition, click one of the icons: 59. The settings field for the selected condition will appear.

To delete a condition:

  • Click the icon of the added condition again.
  • Call the context menu by clicking the 24 button and click Delete.

Condition types:

  1. Internet connection (52). Website availability check. To add/change the address, click the 26 icon. State the site IP address or a site address without protocol in the field, for example, elma-bpm.com. The condition works similarly to the ping command in the Windows command prompt.
  2. Waiting for image (43). Image availability check. You can use this condition if interface elements appear or disappear with a delay. For example, if a long-running operation starts after clicking a button. At this point, a warning window or a progress indicator is displayed. When the operation is over, a new window/a pop-up element/a status bar element, etc. may appear.

When you add this condition, you will see the following settings:

basic-activity-settings-6

Search method:

Appear. Waits for the set element to appear.

Disappear. Waits for the set element to disappear.

Number of attempts to check the condition. Specify how many times will the element's appearance/disappearance be checked. The default value is 1.

The interval between condition checks. Time between the element appearance/disappearance checks. The time measures in milliseconds, the default value is 10.

Waiting for image. Screenshot of the element, whose appearance/disappearance should be awaited.

Search method. Selection of the element search method, whose appearance/disappearance should be awaited. To specify the interface element, click the search method button button. The selection of an element is similar to the selection of a search method during the activity recording.

Number of search attempts and interval (ms). Determine the number of attempts that the bot should make to find the selected interface element. The default value is 10. You can also set a timeout between the bot attempts to find the required interface element. The timeout interval is set in milliseconds. The default value is 500. To edit the default values, click the 65 icon, enter the value and save it by clicking anywhere on the screen or using the 64 icon.

XPath path. A path to the web page element that is set using the XPath language. The element is set in the same way as in the Parameters Tab .

The Control box is described in the Control box article.

  1. Program availability (checking software icon). Checking if the program is available in the system.

To add/change the program name, click the 26 button.

начало внимание

The program name must be set in accordance with the Windows registry.

конец внимание

Message to log files

You can specify the data that will be written to log files before or after the activity is performed. It enables you to control process execution. Read more about log files in the System logs monitoring article.

To do this, click the 66 button and fill in the Message for the log field. The message can contain text and values of process context variables. Click the add variables button button and select a variable. The added variables are displayed as {$variable name}. You can fill in the field manually following the same format.

Found a typo? Highlight the text, press ctrl + enter and notify us