Skip to main content

How to add and use a Web Step

Written by Ines

Prerequisite

Before adding a web step, you need to have an existing Test Case.

What is a Web Step?

A Web Step is an explicit browser automation command you define with:

  • an Action (what to do)

  • a Description — a natural-language explanation of the step

  • a Type (how to identify the element)

  • a Value (the actual selector or value)

Use it when you need full control on tricky pages.

When to use it

  • Complex targeting: Elements are hard to describe in plain text.

  • Unstable structure: Element text and content changes between visits.

  • Critical paths: You want predictable, repeatable behavior.

Add a Web Step

  1. Open your Test Case.

  2. Click Add New Step.

  3. In Step type, select Web Step.

Configure the step

  • Action: Choose what to do (for example: Click, Type, Select, Check, Hover, Scroll, Wait for visible).

  • Description: Add a short, human-friendly explanation of what the step is doing.

  • Type: Select how the element is identified — CSS, XPath, ARIA Label, Text.

  • Value: Enter the corresponding selector/value

A Web Step is added to a test case: Step type Web Step, a description, the Click action, the XPath type and its value. Then the test case runs and its 3 steps pass.

Complete List of Web Step Actions

Below is a comprehensive reference of every available web step action, organized by category.

Navigation & Tab Management

These actions control page navigation and tab behavior. No selector required.

Action

Code

Description

Go Back

goback

Navigate to the previous page in the browser history.

Go Forward

goforward

Navigate to the next page in the browser history.

Reload

reload

Reload the current page.

Switch To Tab

switchtotab

Switch to an already-open browser tab. Requires a value (tab index or identifier).

Open New Tab

opennewtab

Open a new browser tab. Optionally provide a URL as the value.

Waiting

These actions pause execution until a condition is met. Useful for dynamic pages.

Action

Code

Description

Wait For Timeout

wait

Pause execution for a specified duration (in ms). Requires a value (timeout in milliseconds). No selector needed.

Wait For Selector

waitforselector

Wait until an element matching the selector appears in the DOM. Requires a selector.

Wait For Load State

waitforloadstate

Wait until the page reaches a specific load state (e.g., load, domcontentloaded, networkidle). Requires a value. No selector needed.

Wait For URL

waitforurl

Wait until the page URL matches a specified pattern. Requires a value (URL or URL pattern). No selector needed.

Element Interaction

These actions interact with elements on the page. All require a selector unless otherwise noted.

Action

Code

Description

Click

click

Click on an element. Requires a selector.

Double Click

dblclick

Double-click on an element. Requires a selector.

Right Click

rightclick

Right-click (context menu) on an element. Requires a selector.

Middle Click

middleclick

Middle-click on an element (typically opens link in new tab). Requires a selector.

Click At

clickat

Click at specific page coordinates. Requires x and y coordinate values instead of a selector.

Hover

hover

Hover the mouse over an element. Requires a selector.

Drag

drag_drop

Drag an element and drop it on another. Requires a source selector and a target selector/coordinates as value.

Input & Selection

These actions fill in or modify form fields. All require a selector and typically a value.

Action

Code

Description

Fill

input

Type text into an input field (clears existing content first). Requires a selector and a value (text to enter).

Clear

clear

Clear the content of an input field. Requires a selector.

Press

press

Press a keyboard key or key combination (e.g., Enter, Tab, Control+A). Requires a value (key name). Selector is optional (targets focused element if omitted).

Select

select

Select an option from a <select> dropdown. Requires a selector and a value (option value or label).

Open Dropdown

open_dropdown

Open a dropdown element without selecting. Requires a selector.

Check

check

Check a checkbox or radio button. Requires a selector.

Uncheck

uncheck

Uncheck a checkbox. Requires a selector.

Select Text

selecttext

Select/highlight text within an element. Requires a selector.

Focus & State

These actions manage element focus and visibility.

Action

Code

Description

Focus

focus

Set focus on an element. Requires a selector.

Blur

blur

Remove focus from an element. Requires a selector.

Scroll Into View

scroll

Scroll the page until the element is visible in the viewport. Requires a selector.

Screenshot & Export

These actions let you capture visual snapshots and export page content directly from a web step.

Action

Code

Description

Screenshot (Viewport)

screenshot_viewport

Capture a screenshot of the current browser viewport. Add an optional selector to capture only one element.

Screenshot (Full Page)

screenshot_full

Capture a full-page screenshot (includes content below the fold). No selector required.

PDF Export

pdf_export

Export the current page as a PDF file. Chrome/Chromium only. No selector required.

Extract File

extract_file_from_page

Extract structured data (e.g., CSV) from the page content. Supports options to remove empty columns, remove empty rows and limit the number of rows. No selector required.

Capture part of the page

To capture one element instead of the whole viewport, choose Screenshot (Viewport) and fill the Selector (optional) field with the selector of that element. Thunders then captures only the element that the selector finds. Leave the field empty to capture the whole viewport.

Extract File options

When you choose Extract File, enter the XPath of the table in Table XPath. This field is required. Two options control the rows of the CSV file:

  • Remove empty rows: removes each row whose cells are all empty. The header row always stays, and a row with at least one value stays. This option is on by default.

  • Row limit (optional): keeps only the first rows of the table, up to the number you enter. The header row is not counted. Thunders counts the rows after it removes the empty rows. Leave the field empty (All rows) to extract all the rows.

With a row limit, Remove empty columns checks only the rows that are kept. A column is removed only when its header is empty and all its cells in those rows are empty.

Name the output file of a capture step

Screenshot (Viewport), Screenshot (Full Page), PDF Export (Chrome/Chromium only) and Extract File each produce a file. They have two more options:

  • File name (optional): the name of the output file. Thunders adds the extension (.png, .pdf or .csv). You can use [VARIABLE] placeholders, which Thunders replaces when the test runs. Leave the field empty to get a generated name.

  • Add to test assets: saves the file to the Test Assets of the project on every run. The file replaces a Test Asset that has the same name.

Below these options, the step shows the variable that holds the file. Use this variable in later steps, for example to upload the file, to assert on it, or as the reference image of a Visual compare step.

File name

Add to test assets

Variable

Empty

Off

The next [DOWNLOADED_FILE_N]

login-page

Off

[DOWNLOADED_FILE_LOGIN_PAGE_PNG]

login-page

On

[FILE_LOGIN_PAGE_PNG]

A file larger than 20 MB is not added to the Test Assets. The step still runs, and the file stays in the results of the run.

How to get a selector

Using browser developer tools

1. Use this method when your Selector type is CSS or XPath:

  • Right-click the element and choose Inspect.

  • In the Elements panel, right-click the highlighted HTML.

  • Choose Copy → Copy selector (CSS) or Copy → Copy full XPath.

  • Paste it into the Selector field of your Web Step.

In the browser developer tools, an element of the page is inspected, then copied from the Copy menu.
A second example: the same element is inspected, then copied from the Copy menu.

2. If your Selector type is ARIA Label or Text:

  • ARIA Label: Enter the value of the element’s aria-label attribute (you can check it in the HTML).

    • Example: if the element has <button aria-label="Submit">, use Submit.

  • Text: Enter the visible text that appears inside the element.

    • Example: for a button showing “Login”, use Login.

Tips for reliable selectors

  • Prefer CSS selectors over XPath when possible.

  • Target stable attributes (for example, data-testid, aria-label, persistent class names).

  • Avoid dynamic IDs or deeply nested paths that may change.

  • Make the selector unique to one element.

Other related reads you might find useful:

Did this answer your question?