Skip to main content

Web Macro

What is it?

A Web Macro task automates a process that happens in a web browser. You record yourself working through the process in an embedded browser, and RPA captures each interaction as a step. Playing the task back repeats those steps against the same pages.

Because the task drives its own browser rather than one on somebody's desktop, it does not need a signed-in Windows session. It can run on a host where nobody is logged in.

It does need a Windows account to run as: the execution user set on the task. A task with no execution user fails, so set an Execution Context on the task. The task editor prompts you with the Execution Context Required window when it is missing — see Task Types.

Web Macro or Robot Task?

Use a Web Macro when the process happens entirely in a browser. It targets page elements directly, which survives the page moving or resizing, and it needs no desktop session.

Use a Robot Task when the process also involves Windows applications, or when it has to drive the user's own browser rather than an embedded one.

How a task is built

Most of a Web Macro is recorded rather than assembled by hand.

  1. Open the task and select the Web macro tab, then the Actions tab.
  2. Select Record. The Web recorder window opens.
  3. Enter the starting address in the recorder's address bar, then work through the process. Each interaction becomes a step.
  4. Select Stop, then answer Yes to "Do you want to save the recorded actions?".
  5. Review the steps on the Actions tab, adjust individual steps as needed, and save.

The steps appear as a sequence you can reorder, disable, or edit — right-click a step for Edit action and Disable.

Recording replaces the existing actions

Recording is not additive. When you save a recording, the actions you just recorded replace everything the task had before — the recorder always starts from an empty sequence. To extend a task, edit its existing steps rather than re-recording, or record the whole process again from the start.

What recording captures on its own

Simply working through the process records these:

What you doStep recorded
Select something on the pageClick element
Type into a fieldPopulate field
Choose from a listSelect element
Select an optionCheck element
Copy or cut a valueCopy value
Go to an addressNavigate to URL
Open, switch, or close a tabCreate tab, Change tab to '…', or Close tab '…'
Save a file the page offersDownload file
Choose a file in an upload promptUpload file
Answer a browser sign-in promptAuthenticate
Answer a page's own message or confirmationRespond to JS dialog

What you add deliberately while recording

Some steps have nothing to observe, so you ask for them from the recorder's menu — right-click the page, or use the toolbar. The menu names them after the action to add rather than after the step:

Menu itemStep recorded
Add Screenshot actionTake screenshot
Add Print actionPrint page
Add Save Source actionSave page source
Add Copy Link Address actionCopy link
Add Extract Data actionExtract data
Add Extract Table actionExtract table
Add Proxy actionSet proxy settings
Add Inject JS actionInject JS script

Add Copy Link Address action and Add Extract Data action act on a particular element, so right-click the element you want first, then choose the action.

Add these from the recorder, not the toolbox

Check element and Set proxy settings have no settings window, and a Web Macro has no properties panel either, so a step you drag in from the toolbox cannot be configured at all — selecting Edit action on one does nothing. Record these steps instead of adding them by hand.

Authenticate is not in the toolbox at all. Recording is the only way to get one, and a recorded Authenticate step cannot be edited afterwards either — to change it, record that part of the process again.

How a step finds its element

Every step that acts on the page has a Source tab with three ways to identify the element. Recording fills this in for you; you edit it when a step stops finding its target.

ModeYou provideUse when
RelativeElement path:, and Frame path: if the element is inside a frameThe default, and what recording produces
By searchSelector:, Attribute:, Regex value:, and Position:The element has no stable path but does have recognizable content
By positionX: and Y:Nothing else identifies it. Fragile — the page must lay out identically every time

By search finds every element matching the selector, keeps those whose chosen attribute matches your expression, and takes the one at Position:First, Last, or Specific with an index you type. The attribute list offers the common ones (innerText, innerHTML, outerText, outerHTML, id, class, style, href, target, title, type, name, value), and you can type any other attribute name.

By search does not look inside frames

By search only searches the main document. If your element is inside a frame, use Relative with Frame path: set.

By position is only offered on Click element, Download file, and Key event. On every other step type the option is greyed out.

Waiting

Waiting is the single most common cause of a task that works while you watch it and fails when it runs unattended. There are two controls per step, on two different tabs.

ControlWhereWhat it doesDefault
Wait element and its timeoutSource tabWaits for the element to appear before acting. On by default, 60 secondsOn, 60 seconds
Allow to ignore the elementSource tabContinues instead of failing if the element never appearsOff
Wait before execute: and Wait after execute:Wait tabFixed pauses either side of the step, in milliseconds500 each. Recorded tab steps come out at 2000 before, 0 after

RPA also waits for the page to finish loading before each step acts, for up to a minute. That is automatic.

The fixed pauses are milliseconds, and they add up

Wait before execute: and Wait after execute: default to 500 milliseconds each, and the fields do not say what unit they use. A forty-step recording therefore spends about forty seconds waiting even when every page responds instantly.

To change them across a whole task rather than step by step, use Set wait for all actions on the Actions tab. Prefer lowering the fixed pauses and relying on Wait element, which waits only as long as it needs to.

Getting data out

Four steps write a value into a variable:

StepWhat it savesWhere you name the variable
Extract dataOne attribute of one elementDestination tab, under Save to
Copy linkThe link address of the elementVariable tab, under Save to
Save page sourceThe page's HTMLVariable tab, under Save to
Download fileThe path of the saved fileVariable tab, under Local download path Variable

You name the variable yourself — there is no automatic naming. Type a new name or pick an existing one from the list.

Copy value does not write a variable. It records the value it copied for a later Paste step, and its Copy tab shows that value with a Mask value button for anything sensitive.

Extract table works differently: it walks a repeating structure or an HTML table, optionally across several pages, and writes the result as delimited text to a file or to the task's output rather than to a variable. You name its columns yourself under Data column name: and URL column name:.

Mostly user variables

Extract data, Save page source, and Download file write user variables only — the scope picker is collapsed to a fixed User Variable label, and a task that previously specified a job variable has its key carried over to the user variable when you open the step.

Copy link is the exception: it still offers a Variable type: choice of User Variable or Job Variable.

Clicks that open a new tab or window

A browser only opens a new tab for a click it believes a person made, so a recorded click on such a link needs to be replayed as real mouse input rather than a scripted one. A click seen to open a window is always replayed that way; beyond that, the recorder's Force native clicks option decides whether every other recorded click is too. A task you create in 1.2.0 starts with it on.

This has its own page — see Native Clicks in Web Macros.

Troubleshooting

SymptomCauseWhat to do
A step fails reporting the element was not foundThe page changed, or the step's identification no longer matchesOpen the step's Source tab. Try By search with a stable attribute, or correct the element path
A click appears to do nothing on playbackThe click needed to be a native clickSee Native Clicks in Web Macros
The task works when you watch it but fails unattendedTiming — a page is slower without a person pausing between actionsConfirm Wait element is on for the failing step and raise its timeout, rather than raising the fixed pauses
A step inside a frame is never foundThe step uses By search, which ignores framesSwitch to Relative and set Frame path:
A task runs far slower than the process takes by handThe default fixed pauses on every stepLower them with Set wait for all actions
Playback acts on the wrong tab, or a pop-up breaks the runThe task predates 1.2.0, or the page opens and closes windows in a way the recording did not captureBrowser tabs were only modelled properly in 1.2.0, so re-record a task made on an earlier version. If the task was recorded on 1.2.0, check the tab steps against what the page actually does — a page that opens a window and closes it again can leave a step that closes the wrong tab. Delete or disable that step, or record that part again
A step cannot be edited — Edit action does nothingCheck element, Set proxy settings, and Authenticate have no settings window, and a Web Macro has no properties panelDelete the step and record that part of the process again

FAQs

Does a Web Macro need a signed-in user? No. It runs in its own host process with no interactive session. It does need an account to run as — its execution user. See Unattended Session.

Which browser does it use? An embedded browser that ships with OpCon RPA. It does not drive Chrome, Edge, or Firefox on the desktop, which is why it can run with nobody signed in.

Can I edit a recording rather than starting over? Yes — steps can be reordered, disabled, and edited individually. You cannot add to a recording by recording again, though: a saved recording replaces the whole sequence.

Can it sign in to a site? Yes. Typing credentials is recorded like any other typing, and a browser sign-in prompt is recorded as an Authenticate step. Use a masked value or an RPA credential rather than putting a password in a recorded field.

Can it handle a site that opens pop-ups? Usually. Tab and window handling is recorded, and clicks that open windows are replayed as real mouse input. Review the recorded tab steps before relying on the task, and test it end to end — a page that opens and closes windows on its own is the case most likely to need a step adjusted. See Native Clicks in Web Macros.

Can it read a table off a page? Yes, with Extract table, which can follow pagination. Its output goes to a file or the task output rather than to a variable.

Why is my task so slow? Almost always the per-step fixed pauses, which default to 500 milliseconds before and after every step.

Glossary

TermDefinition
Web MacroAn OpCon RPA task type that automates a process in a web browser, built by recording against an embedded browser.
StepOne recorded interaction in a Web Macro, such as a click or a field entry.
Element pathThe recorded route to an element on the page, used by the Relative identification mode.
Frame pathThe route to a frame within the page, when the target element sits inside one.
Native clickA click replayed as real mouse input, which a browser treats as an action by a person.