Skip to content

Web Testing with the Browser Library in Robot Framework

26-08-2026 Roy de Kleijn
Web Testing with the Browser Library in Robot Framework

If you are automating the web with Robot Framework today, the Browser library is the modern choice. It is built on Playwright, which means fast, reliable, cross-browser tests with a lot of the old flakiness designed out.

Why it stands out

Two things make the Browser library a strong default.

It runs on Playwright's engine, so it drives Chromium, Firefox and WebKit from the same tests, and it is quick.

It waits automatically. Before it acts on an element, it waits for the page to be ready and the element to be actionable. That single behaviour removes a whole category of the manual sleeps and retries that made older web tests brittle.

A first taste

Once the library is installed (see the install guide, which uses uv), a test reads like this:

*** Settings ***
Library    Browser

*** Test Cases ***
A Registered User Can Log In
    New Page       https://demo.example.com/login
    Fill Text      id=username    standard_user
    Fill Secret    id=password    secret
    Click          id=login
    Get Text       body    contains    Welcome

New Page opens a page, Fill Text and Click interact with it, and Get Text reads back and checks the result. Each step waits for the page on its own, so there are no sleeps in sight.

What the library gives you

At a high level, the Browser library covers the everyday needs of web testing:

  • Navigating and managing pages and browser contexts, so tests stay isolated from each other.
  • Interacting with the page, such as clicking, typing and selecting.
  • Reading values and asserting on them, with built-in waiting.
  • Handling the modern web, including multiple tabs, file uploads and network conditions.

The detail of how to combine these into reliable, maintainable flows, and how to structure them so they survive a redesign, is exactly what a structured course is for.

A shortcut for getting started

Writing a first test by hand is a good way to learn, but once you know your way around you can move faster. robotframework-browser-recorder, a tool we maintain, records your clicks in the browser and turns them into Browser library keywords, which is a quick way to capture selectors and scaffold a test. Add it with uv:

uv add robotframework-browser-recorder

You can find it on PyPI. Treat what it produces as a starting point to tidy up rather than a finished test, and reach for stable selectors when you refine it.

The thing that decides reliability

Most flaky web tests do not fail because of the framework. They fail because of fragile selectors, the way you tell the library which element you mean. Getting selectors right is the highest-value habit in web automation, so it has its own guide: writing stable selectors with the Browser library.

Go further

Our Robot Framework Certified Professional course covers the Browser library in depth, from waiting strategies and assertions to structuring tests that stay maintainable, and prepares you for the RFCP exam.

Frequently asked questions

Is the Browser library better than SeleniumLibrary? For new projects it is usually the better default, because it is built on Playwright and waits automatically, which reduces flakiness. SeleniumLibrary is still a solid choice where you need it.

Does it support Chrome, Firefox and Safari? It drives Chromium, Firefox and WebKit, which covers the major engines, from the same tests.

Do I need to write my own waits? Rarely. The library waits for elements to be ready before acting, so most of the manual waiting that older tools needed is gone.


Next: writing stable selectors with the Browser library, or see Robot Framework vs Playwright.

Share:
Roy de Kleijn

Test Automation Expert

With over 15 years of experience in software testing and test automation, Roy helps teams improve their testing processes.

Get Robot Framework certified

Go from the basics to exam-ready at your own pace with the online RFCP course.