Skip to main content

Robot Task Activities - Web Macro

The Web Macro category contains activities that drive a web browser: navigating, clicking, filling in fields, extracting data, and transferring files.

Required Nesting

Web Macro activities must be nested correctly or they will not run:

  • All Web Macro activities must be inside a parent Open browser activity.
  • All child Web Macro activities must be inside a parent Launch new instance activity.
Sequence
Open browser
Do
Launch new instance
Actions
Create tab
Navigate to URL
Click element
...

Rather than building this by hand, you can record the actions in a Web Macro task and copy them into a Robot Task. See Recording Web Macro for Robot Task.


Open browser

Opens the browser window. This is the outermost Web Macro container.

  • Click Edit action in the context menu to record web macro actions.
  • Click Browser settings in the context menu to open the browser settings window, which offers the same options as the Web Macro task.

Browser settings include:

SettingDescription
Load imagesLoad images on the page. Disabling this speeds up page loads.
Store cookiesPersist cookies between runs.
Block popupsSuppress popup windows.
Lite modeReduced feature browser mode.
Disable WebSecurityDisable browser web security restrictions.
Override User-AgentSend a custom User-Agent string.
Override refererSend a custom referer value.
Accept-LanguageThe Accept-Language header sent with requests, for example en-US.
Google APIGoogleClientID, GoogleAPIKey, and GoogleClientSecret values.

Launch new instance

Launches a new web instance. Every other Web Macro activity goes inside this activity's Actions body.

Click Edit action to open the settings window.

Each Web Macro activity has its own settings window that includes a Wait tab:

SettingDescription
Wait before executeWait time in milliseconds before the activity executes.
Wait after executeWait time in milliseconds after the activity executes.

Click element

Clicks the specified web element.

SettingDescription
Allow to ignore the elementContinue the sequence if the element is not found by the given path, instead of throwing an exception.
Wait elementTimeout in seconds the activity waits for the element to appear.
RelativeIdentify the element by its path.
Frame pathThe CSS selector for the frame containing the element, if the element is inside a frame.
Element pathThe path to the element. Supports CSS selectors and XPath.
By positionClick the element by X and Y coordinates.
By searchFind the element by searching. Useful when the element's path changes between runs.

How By search works: all elements matching the Selector are collected, the specified Attribute value is read from each one, each value is tested against the Regex value, and the element at the ordinal Position in the filtered results is returned.

For full detail on all three addressing modes, see Element Path.

Allow to ignore the element is the only reliable error handling option for Web Macro activities. A TryCatch activity cannot catch a Web Macro exception, because the sequence is forcibly stopped. See Error Handling.


Checked element

Checks or unchecks the specified web element. Same settings and interface as Click element, plus:

SettingDescription
StateThe checkbox state to apply.

Copies the link of the specified web element to the clipboard. The Source tab holds the same element addressing settings as Click element.

Use the Variable tab to save the link to a variable instead:

SettingDescription
Job VariableSave the link to the named Job variable.
User VariableSave the link to the named User variable.
Variable typeThe data type of the target variable, for example String.

Copy value

Copies the value of the specified web element to the clipboard. Element addressing settings are the same as Click element.


Download file

Forces a download from a specified URL, or clicks a web element to start a download.

SettingDescription
Force downloadDownload the file directly from a URL address.
Original file/pathThe URL address of the file.
CredentialThe credential used to access the save location.
FolderThe folder the file is saved to.
File maskThe file name to save as.
Overwrite optionsWhat to do if the target file already exists.

If you do not have a direct URL, uncheck Force download to enable the Element tab, then fill in the element properties for the link or button that starts the download.


Extract data

Extracts data from the specified web element.

Extract table

Extracts an HTML table from the page. Use this to pull a table straight into a List Variable for row by row processing.


Inject JS script

Injects and executes JavaScript code in the page. Enter the JavaScript to run in the Inject JS tab.

Use this for interactions that the standard activities cannot express, such as scrolling an element into view or reading a value computed by the page.


Respond to JS dialog

Responds to a JavaScript dialog box.

SettingDescription
Input dialogThe message entered when an input dialog box appears.
Button dialogThe button invoked when a dialog box appears: Yes/Ok or No/Cancel.

Click Mask value to hide the input text, for example when entering a password.


Populate field

Populates the specified web element with the specified value. Element addressing is configured on the Source tab, the value on the Populate tab.

SettingDescription
ValueThe value that will be populated.
Mask valueHides the value text, for example when entering a password.
Milliseconds per characterTime in milliseconds between sending each character, simulating typing.
Is EnterSend the Enter key after populating the field.

For guidance on targeting form fields reliably when a page reorders them, see Web Input - Element Path.


Prints the web page.

SettingDescription
Select printerThe printer to use, chosen from the printers installed on the computer.
Printer settingsPage range, number of copies, duplex, and orientation.

Save page source

Saves the source code of the web page to the specified variable. Select the Job or User variable that receives the page source.


Navigates to the specified URL address.

SettingDescription
URLThe URL address to navigate to.

Create tab

Creates a new tab. The settings window contains the Wait tab only.


Take screenshot

Takes a screenshot of a web page and saves it to a specified file.

SettingDescription
CredentialThe credential used to access the specified path.
FolderThe folder path the image is saved to.
File nameThe file name for the final screenshot image.
Overwrite optionsWhat to do if the specified file already exists.
Screenshot typeWindow captures the visible part of the window. Page captures the entire page.

Upload file

Clicks the specified web element and uploads a file. Fill in the File filter fields to select the files to upload.

The file filter offers tabs for Location, Content, Date, Size, Attributes, Result, and Test, including:

SettingDescription
CredentialsThe credential used to access the folder.
FolderThe folder to look for files in.
Include sub foldersSearch subfolders as well.
Exclude folder(s)Folders to skip.
Include file maskThe mask matching files to upload, with Is regex and Case sensitive options.
Use file exclusionEnable an exclusion mask, with its own Is regex option.

Set proxy settings

Uses the specified proxy server to access the web page.


Tips

  • Record the sequence in a Web Macro task first, then copy it into the Robot Task. It is much faster than assembling the nesting by hand and guarantees the structure is correct. See Recording Web Macro for Robot Task.
  • Replace recorded positional paths with attribute based CSS selectors before putting a task into production. Recorded positions break the first time the page layout changes.
  • Set Wait element rather than adding fixed waits between activities. It continues as soon as the element appears.
  • Enable Allow to ignore the element on activities where a missing element is an acceptable outcome, such as dismissing a cookie banner that may or may not be shown.
  • Use Mask value on any Populate field or Respond to JS dialog activity that handles a password, so the value does not appear in the task log.
  • Turning off Load images in browser settings noticeably speeds up page loads on image heavy sites.