Branch on a web element/condition (Smart HTML IF)
Browser ModeRunMacro 3.5+
The Smart HTML IF command checks a web condition — element exists/visible, text contains, attribute contains, URL contains/regex, or a variable condition — then jumps to the IF (true) or ELSE (false) label.
Dialog & quick setup

- Add a Smart HTML IF command.
- Choose the condition (Exists/Visible/Text contains/URL contains/Variable...), and enter the expected value if needed.
- Set IF/ELSE labels. Save.
Options reference
Modes & when to use
Browser Mode
Best for
- Act only when an element/message appears.
- Branch by the current URL (logged in or not...).
- Check page text/attribute to decide.
Use an alternative when
- Do not use IF Element to wait for appearance; it is a point-in-time condition, not a wait.
Before you run
- Add Smart HTML IF to the macro.
- Prepare the data or target that Smart HTML IF will use.
Example workflow
Example: skip if already logged in
- Smart HTML IF, condition URL contains
/dashboard. - IF label =
logged_into skip login. - ELSE =
do_loginto log in.
Expected result: After execution, Smart HTML IF completes the described action and makes its result available to the next step.
Tips & limitations
Combine with Label/Goto to build smart web flows (re-login when logged out...).
- The DOM can change immediately after the check; multiple matches or a wrong frame can choose an unexpected branch.
Applies to RunMacro 3.5+ · Browser Mode · Windows 10/11
