Skip to content

QWeb: Reliable Web Automation QWeb Overview

Why QWeb?

QWeb is text-first. Tests describe what the user sees and does. CSS selectors, XPath and image comparison are available when a more precise match is needed.

  • Human-readable syntax: Write tests that read like sentences.
  • Text-first locators: Find elements by visible text, labels, nearby anchors and attribute values such as tooltips and ARIA labels.
  • CSS and XPath: Use an explicit selector when text or attributes are not a unique, stable match. A well-built CSS selector can be more reliable than text.
  • Automatic waits: Built-in retry logic in most keywords reduces the need for explicit waits.
  • Automatic frame handling: Search across frames without manual frame switching.
  • Shadow DOM support: Text, Item and CSS locators can search open shadow roots when that support is enabled.

QWeb Overview

Philosophy

Prefer the simplest locator that uniquely and reliably identifies the intended element. Text, attributes, CSS, XPath and images are different levels of abstraction, not a ranking of reliability.

  1. Text and attributes: For most interactions, name the visible text or a descriptive attribute.
  2. Explicit selectors: Use CSS or XPath when the match depends on structure or on stable attributes.
  3. Images: Use image comparison when the element cannot be identified through the DOM.

Quick Example

A login written with the visible text on the page:

*** Settings ***
Library    QWeb

*** Test Cases ***
User Can Log In
    Open Browser    https://example.com    chrome
    Type Text       Email       demo@example.com
    Type Text       Password    changeme
    Click Text      Sign in
    Verify Text     Dashboard

Getting Started

Ready to start automating?