Edit a task recorded with the Universal Recorder
- Updated: 2023/02/13
Edit a task recorded with the Universal Recorder
After recording a task, edit the Capture actions to change the window, capture a different object, select a new action, enable background processing, enter a different wait time, or save the output to a variable.
Prerequisites
Select the List view to see the full details of each action.
- Change the application window in which you want to perform the operation, or add a wildcard to the window title.
- Change the properties of the captured objects.
- Specify the action you want to perform on the captured objects.
- Introduce a delay before the next action is performed.
- Specify the variable you want to use to store the output.
To add a Capture action to the task, see Using the Capture action.
Procedure
To edit a recorded task, perform the following steps:
- Open the bot that contains the recorded actions you want to edit.
- Click the Capture action that you want to edit.
Make the following changes, as necessary:
- Change the window selection to the Currently active window option.
- Optional:
Insert a wildcard character (*) in the
Window title field to search for window titles that can
change. You can specify one or more wildcards (*) at the start, middle, or end of the
value.
For example, to perform an operation on any window that has Microsoft in the title, use a wildcard to indicate any string by adding it before or after the value: *Microsoft*. The bot first searches for the exact window title (Microsoft), and if it does not find a match, it searches for windows with the term Microsoft anywhere in the title.
You can use a regular expression (regex) to identify a window title. Select the regular expression condition as either String or a Pattern and then enter the value. By default, the Window title field is case-sensitive.
To identify a browser title, you can enable the Case sensitive option to match the letter case, or disable the option to identify a window title where the letter case does not match.Note: Ensure that the minimum Bot Agent version installed on your system is the version that was released with Automation 360 v.26. If you have a Bot Agent version released with Automation 360 v.25 or earlier, then by default, the window title will be identified only with matching letter case (case-sensitive).For example, to match all window title names beginning with a word followed by- Notepad
, you can enter the String value as * -Notepad, or use Pattern value as ((\w)\s)*document-Notepad for only those window titles that match this pattern.Note:- When you use a regular expression of type String with -title as the input value for a window title in any action, the bot might encounter a run time error. To prevent the run time error, ensure that when you add the string input as *-title, the application with the specific title is open. The asterisk (*) is just a character, not a wild card character.
- When you use a regular expression of type Pattern with
-title as the input value for a window title in any
action, the bot might encounter a run time
error because the input value *-title is
incorrect.
Ensure that you use valid regex patterns.
Note: During runtime, verify that the Task Bot identifies the correct window. If it does not, do the following:- Open the application or browser window.
- Drag a Window > Get active window title action above the Recorder > Capture action.
- Insert a string variable into the Assign the window title to variable field.
- Drag a Window > Set title action below the Window > Get active window title action.
- In the Window field, insert the window variable generated by the Recorder > Capture action.
- In the New window title field, insert the string variable from the Get active window title action.
- Click Save.
- Optional:
Select the Resize window option to specify the window
dimensions.
This option delivers a more reliable bot. It resizes the window to the dimensions at which the task was recorded, which enhances the ability of the botto identify the target object.
- If the window is maximized when you record the task, this option is not selected.
- If the window is not at the maximum size when you record the task, this option is selected, by default, and the width and height fields are automatically filled with the dimensions of the window.
Note: This option is available only for windows that can be resized. It is not available for the Desktop or Taskbar options. -
Review the Object properties table.
Following are the list of object properties that are selected by default based on the technology type:Note: You do not have an option to select Java or HTML technology explicitly. When you capture an application in auto-detect mode, the Recorder detects the technology automatically based on the application being captured. When the Recorder detects the specific technology, the technology type is displayed within the Object properties.Important: The following list does not include all the properties and is restricted to the most commonly used and important properties based on the technology type.
Technology type Object properties Description HTML Technology Control type This is a read-only property that shows the type of object captured, for example, text box or button. DOMXPath It is the path that is used to locate the control or object that is captured. DOMXPath can be of two types: Relative XPath and Absolute XPath. - Absolute Xpath: It contains the complete path from the
root element to the desired element. For example, an absolute
Xpath for this topic would be
/html/body/div/div[1]/main/div[2]/div/div/div[2]/div/div/div[1]/div/article/main/article/div/p[1]
- Relative Xpath: This is a shorter path that refers to an
element you want to identify. A relative path starts with a
//
symbol. For example, the relative XPath for this topic would be//*[@id="cloud-using-recorder-action"]/div/p[1]
For example, if you want to find the DOMXPath of a particular element on Google Chrome browser, perform these steps:- Select the element for which you want to extract the XPath.
- Right-click the element and select Inspect.
- Right-click the highlighted element in the Element tab.
- Go to Copy > Copy Xpath to copy the relative path and select Copy > Copy full Xpath to copy the absolute path.
Path It is a numeric representation of the position of a particular control in an application. For web applications, the best practise is to use DOMXPath from the search criteria when comapred to Path. HTML name and ID These properties are used to identify an HTML object HTML inner text The DOM innerText Property is used to set or return the text content of a specified node and its descendants HTML tag HTML tags are like keywords that define the way web browser formats and displays the content. For example, if the captured text has an HTML code: <h3 class="search_results-title">Search results for ״string package״</h3>
, then enterh3
in the HTML tag field.Microsoft Active Accessibility Control type This property is used only as a reference to ensure that the correct object is captured Path It is a numeric representation of the position of a particular control in an application Name This specifies a name of an element and works as an identifier ID This specifies the ID of an element and works as an identifier Java Technology Control type This property is used only as a reference to ensure that the correct object is captured Path It is a numeric representation of the position of a particular control in an application Microsoft UI Automation Control type This property is used only as a reference to ensure that the correct object is captured Path It is a numeric representation of the position of a particular control in an application Name This specifies a name of an element and works as an identifier ID This specifies the ID of an element and works as an identifier IsFirst This property enables the bot to detect the first object based on your search criteria instead of traversing the entire tree. You can use this property when an object does not have a unique Automation ID and the object hierarchy changes in the application. Microsoft UI Automation (COM) Control type This property is used only as a reference to ensure that the correct object is captured. Path It is a numeric representation of the position of a particular control in an application. Name This specifies a name of an element and works as an identifier. ID This specifies the ID of an element and works as an identifier. The bot uses the selected properties to identify the object control at runtime.-
Verify that the Control Type matches your
intended object.
For example, when capturing a table from a website, ensure the Control Type and HTML Tag values are Table.If the Control Type does not match your intended object, recapture the object control.
-
Select and assign values to the object properties that you want to
include in the object search.
For a more reliable bot, we recommend that you select only the properties that have static values (such as Name, Class, Type, HTML ID, and DOMXPATH), and deselect the properties that have dynamic values (such as HTML Href, Path or Value), which are subject to change and cause bot errors.It is a best practice to use the wildcard character (*) or variable in object property values to search for objects whose properties are dynamic and changes frequently.Note: Wildcard character matching is currently not supported for SAP technology. When you execute a bot with a wildcard character, it matches the property values exactly as specified in the search criteria.
- Absolute Xpath: It contains the complete path from the
root element to the desired element. For example, an absolute
Xpath for this topic would be
-
Select the Action from the drop-down list.
For a full list of possible actions by object, see Actions performed on objects captured with Universal Recorder.
- If you record a click and
keystrokes in a text box with a Control Type of
Password text
, the Recorder does not capture the keystrokes entered into the field. Instead, the action selects the Set text option and offers options to securely input the password. We recommend that you store the password in the Credential Vault and insert it into the action as a credential. Credentials and credential variables in the Bot editorIf you navigate to the text box using the TAB keystroke instead of a click in an MSAA or SAP application, the Recorder is able to identify fields with a Control Type of
Password text
.We recommend that you use the Set text action without setting a delay time to enter keystrokes into a text field. However, if the text that you want to enter consists of a control key value or a text field requires any key press event, then you must set a delay time between the keystrokes when using the Set text action.
- If the selected Action supports background processing, a Run in the background option appears. Background processing
- If you record a click and
keystrokes in a text box with a Control Type of
- Optional: Enter a value in the Wait for control field to specify the number of seconds the bot must wait for the object control to appear on the application window.
- Optional:
Assign the output to a variable.
The Control Room suggests a descriptive default variable name based on the action you selected in step 8. For example, if you selected Get property, the suggested output variable is
PropertyValue
. If you create several output variables, subsequent variable names are appended with a -1 to avoid duplication. - Perform the Steps 3 through 9 for the other actions that you want to edit in the bot.
- Click Save.
- Open the Capture action.
- Click the Anchor tab.
- Click Capture anchor.
The browser or application window activates with the main object highlighted (the object that you previously captured). A dialog box appears, verifying whether the action has correctly identified the main object.
- If the correct object is highlighted, click Yes, Select
anchor.
Otherwise, click No, I need to correct it to select the correct object.
- Select a nearby object to the target object that is easier for the bot to find.
The object is highlighted with an anchor icon on the right of the object.
- Click Save.