Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs Smart HTML Smart HTML IF
🔀 Smart HTML

Branch on a web element/condition (Smart HTML IF)

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.

Prerequisites#

  • Add Smart HTML IF to the macro.
  • Prepare the data or target that Smart HTML IF will use.

Supported modes#

  • Browser Mode

What it does#

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.

Screenshots & video#

RunMacro Smart HTML IF command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Smart HTML IF command in RunMacro.

When to use it#

  • Act only when an element/message appears.
  • Branch by the current URL (logged in or not...).
  • Check page text/attribute to decide.

When not to use it#

  • Do not use IF Element to wait for appearance; it is a point-in-time condition, not a wait.

Configuration steps#

  1. Add a Smart HTML IF command.
  2. Choose the condition (Exists/Visible/Text contains/URL contains/Variable...), and enter the expected value if needed.
  3. Set IF/ELSE labels. Save.

Every option explained#

Condition#

Element exists/visible, text contains/regex, attribute contains, URL contains/regex, or variable not-empty/contains/regex.

Expected value / Variable / Attribute#

Depending on the condition: the string/regex to match, the variable name, or the attribute to read.

IF label / ELSE label#

If true jump to IF; otherwise jump to ELSE.

Expected result#

After execution, Smart HTML IF completes the described action and makes its result available to the next step.

Real example#

Example: skip if already logged in#

  1. Smart HTML IF, condition URL contains /dashboard.
  2. IF label = logged_in to skip login.
  3. ELSE = do_login to log in.

Limitations and failure cases#

  • The DOM can change immediately after the check; multiple matches or a wrong frame can choose an unexpected branch.

Tips & common mistakes#

Combine with Label/Goto to build smart web flows (re-login when logged out...).

Verification details#

  • commands/smart_html.py
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.