
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
qweb
Advanced tools
Keyword based test automation for the web.
QWeb is a powerful and versatile Robot Framework library designed for efficient, reliable, and maintainable web testing and automation. Its core strength lies in an intuitive, human-readable syntax that allows teams to write and maintain even complex test cases with minimal effort.
QWeb's philosophy is to give you the best of both worlds: text-based automation for 80–90 % of cases where brittle XPath/CSS selectors aren’t needed, and precise DOM targeting for the tricky 10–20 % where they are.
QWeb aims to make web automation easy and maintainable by:
*** 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
See more examples.
Python 3.10-3.13 and Robot Framework 5.0.1 or above.
(Note that support on Macs with Apple based silicon (M1) requires MacOS version 12/Monterey or above or custom installation.)
pip install QWeb
Some Linux distributions (Ubuntu) use snap to install browsers, which brings it's own problems with non-default binary, user data-dir and/or profile location. We suggest installing the browser via terminal, for example:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt-get install -y ./google-chrome-stable_current_amd64.deb
Make sure the following dependencies are installed:
sudo apt-get install python3-tk python3-dev scrot
pip install python-xlib
python3 -m pip install -U pip
python3 -m pip install QWeb
Running the above command installs also supported Selenium and Robot Framework versions + other dependencies.
Since Selenium 4.10.0 browser drivers can be automatically downloaded and installed using Selenium Manager, provided that driver is not found in PATH.
For Chrome browser_version can also be given; if your locally installed Chrome matches this version,
it will be used. If not, a suitable version of Chrome for Testing will be automatically downloaded.
Examples in OpenBrowser keyword documentation
For manual installation of drivers, please refer to Selenium documentation for more information OR use 3rd party packages like WebDriverManager.
NOTE: Manual driver management should only be used in exceptional cases. Letting Selenium Manager handle drivers is the preferred, less error prone option.
See list of keywords and their usage on
The preferred way to interact with web elements is using their text property. Most elements like input fields and dropdowns can also be found by closest label (text).
*** Settings ***
Library QWeb # Import library
*** Test Cases ***
Basic interaction
OpenBrowser https://qentinelqi.github.io/shop chrome # Open chrome and goto given url
VerifyText The animal friendly clothing company # Assert heading text
ClickText Scar the Lion # Click link text
ClickText Add to cart # Click *button* with specific text
DropDown Size Large # Select value (Large) from dropdown (Size)
Most common cases when text or element is not found are:
QWeb searches for visible elements by default, but can be instructed to work with invisible elements as well. See keyword documentation of SetConfig and the following parameters:
Elements under shadow DOM can not be found using xpaths. However, all *Text, *Item and *Input keywords do support extending the search to Shadow DOM elements. We intentionally keep this under separate setting for ensuring compatibility with older test cases.
Example:
*** Settings ***
Library QWeb # Import library
*** Test Cases ***
Click shadow dom element
SetConfig ShadowDOM True # extends search to shadow dom elements
OpenBrowser chrome://settings/content/popups chrome
ClickText Sites can send pop-ups
By default QWeb tries to locate the element 10 seconds (default time can be configured). Timeout can also be individually given for each keyword as an argument.
When text to be found is not unique, an 'anchor' argument can be given to pinpoint which instance of text we want to interact with. Anchor can be either another text nearby or index.
ClickText Sign-in
ClickText Sign-in timeout=30
ClickText Sign-in anchor=Email
ClickText Sign-in index=3
Non-textual locators can be used with ClickElementand ClickItemkeywords.
ClickElement xpath\=//button[@class="my_class"] # xpath
ClickItem Increment quantity # alt text
QWeb includes keywords to interact with table data easily.
Consider the following table as an example:

UseTable Firstname
${row}= GetTableRow //last # returns 5
${row}= GetTableRow //last skip_header=True # returns 4
...
${row}= GetTableRow Jim # returns 4
${row}= GetTableRow Jim skip_header=True # returns 3
${cell_value}= GetCellText r1c2 # Returns "John", first name is column 2.
${cell_value}= GetCellText r-1/c2 # Returns "Tina", -1 points to last row
${cell_value}= GetCellText r-2/c2 # Returns "Jim", -2 points to second last row
QWeb's behavior can be changed with SetConfig keyword.
SetConfig SearchMode Draw # Highlight all found elements with blue rectangle
SetConfig DefaultTimeout 60s # change default/automatic timeout for all keywords
VerifyText User account created # Re-tries to find text "User account created" 60 seconds and then fails, if text is not visible
QWeb can be used directly with Python as well.
from QWeb import QWeb
qweb = QWeb()
qweb.open_browser("about:blank", "chrome")
qweb.go_to("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select")
title = qweb.get_title()
# returns 'W3Schools Tryit Editor'
qweb.verify_text("The select element")
qweb.drop_down("Choose a car", "Saab")
qweb.click_text("Submit")
qweb.verify_text("Your input was received as:")
qweb.verify_text("cars=saab")
More examples on QWeb tutorial.
See RELEASE.md
Found an bug? Want to propose a new feature or improve documentation? Please start by checking our contribution guide
Want to join the community at Slack? On the official Robot Framework workspace, there is a QWeb channel where you can discuss with others about keywords, issues and improvements. Join Now
Apache 2.0 License. See LICENSE.
FAQs
Keyword driven automation for the web
We found that qweb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.