Patterson Consulting is Closing

Patterson Consulting, LLC of Tennessee is in the process of closing and all operations will cease effective March 1, 2022. Please refer to our company page or FAQ for details.

Add Activity Call with Element Identification


Now that you understand the basics of inspecting an Element and browsing properties, it is time to enhance the Process from the Getting Started tutorial to execute a search after opening the Google home page.

If you do not have the files from the previous tutorial, you can download a copy.

Before We Begin

We don't want to overwrite the file from the previous tutorial. Before making any changes, we need to save a copy of the Process under a new name.

  1. If not already, open Tutorial1.abprocess.
  2. Select File on the Ribbon Command Bar. This will open the Backstage Menu with a list of commands on the left edge.
  3. Select Save As. The Backstage Menu will close and the Save As dialog will be displayed.
  4. Chose a location for your process (e.g. C:\Users\<name>\Documents\AutoBloks) and name your process Tutorial2. Click the Save button to save your file.

You should now have Tutorial2 open with a single Navigate to URL Activity Call.

AutoBloks Screenshot

Set Value Activity

To change the value of any control, we use the Set value activity. We need to add an Activity Call to our Process for the Set value Activity.

  1. Locate the Set value Activity in the Activities tool window under the Element Interaction category.
  2. Drag the Activity to the Activity Calls list and drop it below the existing Navigate to URL Activity.
Since you learned how to add an Activity Call to a Process in a previous tutorial, we are not repeating screenshots for the above steps.

Your screen should now look like the image below:

AutoBloks Screenshot with Set Value Activity Call

From the image, you can see the Activity Calls list has been updated to reflect the second Activity Call to the Set value Activity (1). Under the Element column, you will also notice that the default identification is listed as id = <empty> (2) with the value in red text. The red text indicates that we need to define the Element whose value will be set by the Activity. Finally, the Input column reflects the Value is also empty (3). Since this argument is optional, you do not have to provide a value and that is why the text is not red.

Typically, optional arguments with empty values are not displayed in the Activity Calls list since the extra information is distracting. Since an empty Value argument for the Set value Activity means any existing value assigned to the Element should be cleared, that makes the empty argument significant and is why it is displayed in the list.

Defining the Element

Element identification is configured in the Instructions pane:

AutoBloks Screenshot with Set Value Activity Call

  1. Select the Identification tab within the Instructions pane.
  2. You can use the resize bar between the Activity Calls list and Instructions pane if you want show more of the information in the Instructions pane and reduce scrolling.
  3. The Identification Technique drop-down is used to define the type of element and method of identification to be used.
  4. Depending on the Identification Technique selected, additional controls will be displayed below to complete the identification.
  5. The Element Picker can be used to select the element you want and have AutoBloks generate a properties-based description. This element is used in the steps below.

In the previous step, we discussed how properties are used to uniquely identify an element, and you used the Element Inspector tool window to see the properties of the search box. You may have even figured out which properties you think would be best to identify that element. While you could manually configure AutoBloks to recognize the element, it is typically easier to let AutoBloks determine the identification for you.

Note: the next steps expect a browser session to already be active and the Google home page to be displayed. If you just completed the previous step of the tutorial, your browser should already be ready. Otherwise, you can refer to the previous step for details about how to start a session.

AutoBloks Screenshot using Element Picker

  1. Click the Element Picker button to open the Element Identification. When the dialog opens, you will automatically be placed in Inspect mode just like you used with the Element Inspector tool window.
  2. Move the mouse to the search box, wait for the highlight rectangle to be displayed, and then click on the highlight rectangle.

Element Picker

There are many types of elements supported by AutoBloks. The Element Picker currently only supports elements of type Control that are used within a web browser. A text box is one example. Other element types include Window, Alert, and Image.

After you select an Element, AutoBloks will analyze that Element and automatically generate the property conditions which must be met for that Element to be uniquely identified. It starts with the most common properties (e.g. id and name), but will add additional properties, as needed, to make sure the element is uniquely identified against all the other Elements on the page.

AutoBloks Element Identification Window

Note: The Google home page does change, and what you see may differ slightly from when this tutorial was written.

The following are the key aspects of the Element Identification window:

  1. The Defined Conditions show you the expected property values of a matching element. In this example, we are looking for an element whose name property exactly equals the value q. Since there is only one element matching that description, no other property conditions need to be defined.
  2. The Add Property Condition button can be used to manually add an additional property condition.
  3. The Known Properties list displays the same properties you saw in the Element Inspector tool window.
  4. To create a new condition from a known property, select any property in the Known Properties list and click the Add Selected Property button. This will add a new property condition to look for the selected property and the inspected value.
  5. The Multiple Match Policy is used to control how AutoBloks handles multiple matches if the given conditions match more than one element. The option of Use first match is the default and provides the best performance.
  6. If you have modified the Defined Conditions or Multiple Match Policy and need to verify the element can still be found, click the Test Identification button. If the element is found, it will be highlighted in the application.

You do not need to make any adjustments to the default values provided for the Element Identification. Click the OK button to accept the values and apply that Identification Technique to your Activity Call. You will now see the Element Identification has been updated.

AutoBloks Element Identification After Picking Element

  1. Since the element you selected is being identified by properties, the Identification Technique has changed to one using Property Conditions.
  2. Just as shown on the Element Identification dialog, the condition for the name property is defined.
  3. The Activity Calls list has also been updated to reflect that the element is being identified as name = q based on the defined conditions.

Advanced Element Identification

The Element Picker makes it easy to identify Elements, but there may be times where you need to manually define the Identification Technique. The Using Browser Development Tools tutorial will demonstrate how to complete the previous steps of this tutorial without using the Element Picker.

Setting Element Nickname

The Activity Calls list for your Process should provide a high-level summary of the activities being performed. While the value displayed in the Element column for the search query text box is accurate, the cryptic name = q may be confusing. We can improve the readability of the Activity Calls list and our run results by giving this element a meaningful nickname.

AutoBloks Screenshot with Search Box Element Identification Nickname

  1. Set Element Nickname to Search Query.
  2. Note how the definition of the Element in the Activity Calls list is now much easier to read and understand.

Element Nicknames

Providing nicknames makes your Process much easier to understand and is highly recommended.

Defining the Query Text

Now that you have defined the target element whose value will be set, it is time to define the search query. As learned in a previous tutorial, we use Arguments to pass values to an Activity.

AutoBloks Screenshot with Search Box Arguments

  1. Select the Arguments tab within the Instructions pane.
  2. Set the Value Argument to AutoBloks by typing the text into the box.
  3. Note that ExtendExistingValue is an optional argument. The user interface makes it clear that the default value is False and the description below the argument clearly communicates when you might need to populate this Argument. Since we do not want to fully define a new query, leave the Argument empty and it will use the default value of False.

Save Changes

Since you have made updates to your Process for the new Activity Call, be sure you save your changes.

For any command like Save that is based on current selection, make sure the Document Window for your Process is selected and has focus by clicking the Title Bar of the Document Window. This ensures the command is routed to the proper selection.
  1. Select File on the Ribbon Command Bar. This will open the Backstage Menu with a list of commands on the left edge.
  2. Select Save. The Status Bar will indicate the Process has been saved.
Patterson Consulting, LLC of Tennessee is in the process of closing and all operations will cease effective March 1, 2022. Please refer to our company page for details.