Editing a Web-only Task with Web Recorder Commands
- Updated: 2020/05/06
Editing a Web-only Task with Web Recorder Commands
You can use the Workbench to edit and enhance the automation tasks that you earlier recorded using the Web Recorder.
When you launch the Workbench, you can add any of the commands that are listed under "Web Recorder".
Using the Web Recorder commands, you can:
- Open and close websites in browser sessions
- Manage web controls
- Download data
- Extract tables
- Test websites and locate broken links
- Extract data
- Navigate URLs
- Extract Website source code
- Search by captions
- Navigate back
- Execute a java script
You can add the following actions to your Web Recorder automation task.
1. Open and Close Browser Sessions
- Open Browser: You can specify a website URL that you want the automation task to open prior to performing actions on that website. For most processes website automation, opening the browser is the first command added to the task, usually followed by commands that manage controls.
- Close Browser: Closes an open browser session that was previously opened using an Open Browser command.
2. Manage Web Controls
Use the Manage Web Controls command to select controls on the web page and work with them.
For example, you can insert actions on links, check boxes, radio buttons, drop-down menus, and other objects.
To use Manage Web Controls, follow these steps:
-
In 'Specify a Website URL/Page' choose either 'Open New URL' or 'Select Page' .
If you specify 'Select Page' you are required to select a page title (html page) that is open, from the list.Tip: Click 'Refresh' if window is open, yet not visible. - Use the Capture button to capture a web control by selecting it with the yellow prompt bar:The control details are displayed.
- Click the Advanced View button if you want to include more options.
- Control Name / Control ID: Searches for the web control based on the control name or ID.
- Caption: Searches for the web control based on the caption name that is entered or selected from the text box. For example, if you record a menu object with a caption titled "Buy Now", this web control lets you search the web page for this caption when the task runs.
- Control Index: Searches for the web control based on the index number of the control, which is stored while recording a web page.
-
Attributes:Searches for the web control based on the tag attributes,
which are stored while recording a web page. You can select the tag attributes
and specify their values for the web page that is being searched.
You can add or delete tag attributes, as required.
Tip: Best Practice is to use 'Search by Caption' as the first option, 'Search by Attributes' as second option, and 'Search by Index' as the third option.
-
Enable or disable 'Page Title' or 'Page URL' to decide whether to play in existing or new Internet Explorer window.Note: Both are enabled by default and the task will play in existing Interenet Explorer window.
-
Specify the action that you want to perform during task play time.Tip:
You can opt to use a Variable while using the actions Set Text and Append Text. If the text needs to be encrypted, you can insert Credential Variables* using function key 'F2' for enhanced security. Refer to Credential variables
*Available in Enterprise edition from version 10.3
- Click Save.
3. Download File
Use this command to download HTTP files. This command does not require a browser.
Common Use Cases: Downloading stock data, log files, security patches, or other files that you routinely need to download.
4. Extract Table
Use this command to select a table on a web page and save the data to a CSV file.
After running the task, including the Extract Table command, Automation Anywhere stores the table data in a system variable named: $Table Column(index)$
You can use this variable to retrieve the data that you extracted in row-and-column format by using a combination of Loops for each row in an Internet Explorer table.
Common Use Case: Transfer data from a web-based ERP system to another application, such as Excel.
Follow these steps to extract table from a website:
- Select Extract Table
- Launch the website you want to extract the table from by clicking on 'Launch'.
- Use the 'Capture Table' button to capture the table by selecting it with the yellow
prompt bar:
The program will display the table number.
- You can optionally save or append the table data to a .csv file. Or you can process the table data using loops within your task. Refer Loop Command for details.
- Click on View extracted table button to preview the table data in the Extracted Table window:
- Click the Advanced View button to add more options such as Session Name, Page Title, Page URL, Extract selected Tag Details to a .csv file.
- Click Save
5. Find Broken Links
Use this command to validate all links on a website or a web page.
After running the command, Automation Anywhere stores the results in a CSV file that you can open in Excel.
Using this file, you can identify any broken links.
6. Extract Data
Extracts text data from a website or a web page.
This command enables you to specify a range of text that you want to copy, using "Before" and "After" keywords.
Example: Given the text string "= Price: $249 xyz"
You want to capture only the price, which is $249. Specify the following range:
Before keyword: "= Price:"
After keyword: "xyz"
7. Navigate URL
Use this command to navigate to a website URL in a browser window that is already open.
8. Extract Source
Use this command to extract source code from a web page.
9. Search by Caption
Use this command to navigate to a caption or title in a browser window that is already open. Navigation using this command is possible even if URLs change.
10. Go Back
Use this command to navigate to the previous URL location that was used during website recording.
11. Execute Java Script
It is mandatory to enter the 'Function Name' without which the specific script named therein will not be executed.
- Ensure JavaScript has been enabled for Internet Explorer. If disabled, you may receive an access denied message. For details refer the Microsoft Support section.
- 'Capture' button disabled? Refer the section on Web Recorder in Troubleshooting Excel Command Tasks for details.