Add Activity Call with Element Identification


Now that you understand the basics of inspecting an Element and choosing an identification technique, 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 Tutorial2Alt since this is an alternative. Click the Save button to save your file.

You should now have Tutorial2Alt 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 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.

In the previous step, we decided to uniquely identify the search text box based on the name attribute having a value of q, so we will now configure AutoBloks to utilize that identification technique.

AutoBloks Screenshot with Search Box Element Identification

  1. Verify Elements of type Control using Simple Technique is the default selection for Identification Technique. If this is not the default, you can choose it from the drop-down by selecting Simple under the Control Elements group. The Simple technique is used most frequently when manually defining element identification and provides several options to identify an element based on a single value like ID or name.
  2. Change the By method selection from ID (the default) to Name since we want to use the name attribute to identify the element.
  3. Set the By value to q since that is the value of the name attribute of the search text box.
  4. Note that the Element value for the Activity Call has been updated to reflect how you are identifying this element.

Element Types

There are many types of elements supported by AutoBloks. Most elements are of type Control, and a text box is one example. Other element types include Window, Alert, and Image. When defining the identification for an element, you will need to be certain you are using the right element type.

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.

Tutorial Summary

You have now completed the steps for this tutorial! During this tutorial, you should have learned:

Hopefully this alternative tutorial has also given you a greater appreciation for when AutoBloks allows you to click on an element and have the description generated for you! If you are unclear about any of these topics, we encourage you to go back and review the steps of the tutorial.