---
title: Selenium testing with Robot Framework | TestingBot Blog
description: |-
  With Robot Framework you can build easy to read test cases, which can then be run via Selenium WebDriver on our Selenium Grid.

  It allows using key...
source_url:
  html: https://testingbot.com/blog/2015/09/23/selenium-testing-with-robot-framework
  md: https://testingbot.com/blog/2015/09/23/selenium-testing-with-robot-framework.md
---

# Robot framework testing

By [Jochen D.](https://testingbot.com/about/jochen-d)2015-09-23

 Share on Facebook 

 Share on Twitter 

 Post on Reddit 

 Share link 

With Robot Framework you can build easy to read test cases, which can then be run via Selenium WebDriver on our Selenium Grid.

It allows using keyword driven, behaviour driven approaches and provides reports in HTML format.

## Setting up Robot Framework

First you have to make sure you've installed [pip](https://pypi.org/project/pip/). To install the other libs, please run: `pip install robotframework-selenium2library requests`

## Running your first test

Below is an example on how to run a simple test on Firefox. When the test has finished, the test name and success state is sent to TestingBot so you can see the test success/failures in our dashboard.

Save the example below in a `test.txt` file:

```python
***Settings***

Library Selenium2Library
Library TestingBot

Test Setup Open test browser
Test Teardown Close test browser

***Variables***

${CREDENTIALS} key:secret (get these for free from testingbot)

***Test Cases***

Simple Test
    Go to https://www.google.com
    Page should contain Google

***Keywords***

Open test browser
    Open browser about: firefox
    ... remote_url=http://${CREDENTIALS}@hub.testingbot.com/wd/hub
    ... desired_capabilities=browserName:firefox,version:62  

Close test browser
    ... Report TestingBot status
    ... ${SUITE_NAME} | ${TEST_NAME}
    ... ${TEST_STATUS} ${CREDENTIALS}
    Close all browsers
```

Save this code in `TestingBot.py`:

```python
import re
import requests
import base64

from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn

def report_testingbot_status(name, status, credentials):
    selenium = BuiltIn().get_library_instance('Selenium2Library')
    session_id = selenium._current_browser().session_id

    token = base64.b64encode(credentials)
    payload = {'test[name]': name,
               'test[success]': int(status == 'PASS')}
    headers = {'Authorization': 'Basic {0}'.format(token)}

    url = 'https://api.testingbot.com/v1/tests/{0}'.format(session_id)
    response = requests.put(url, data=payload, headers=headers)
    assert response.status_code == 200, response.text
```

To run the test, run this command: `pybot test.txt` Once the test has finished running, you will see it in the [TestingBot member dashboard](https://testingbot.com/members).

[← Previous post Chrome and Firefox beta/dev cross browser testing](https://testingbot.com/blog/2015/09/08/chrome-and-firefox-betadev-cross-browser-testing) [Next post → TestingBot Breakpoints to debug your flaky Selenium tests](https://testingbot.com/blog/2015/09/28/testingbot-breakpoints-to-debug-your-flakey-selenium-tests)

## Sidebar

### TestingBot Cloud Testing

Run automated, manual and visual tests on remote browsers and devices. Sign up for a free trial.

[Free Trial](https://testingbot.com/users/sign_up)

### Latest articles

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights)

#### Announcing AI Test Insights

Use AI Insights to quickly discover why an automated test...

[Read: Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright)

#### Selenium vs Playwright 2026

Comparing Selenium vs Playwright - which is the best test...

[Read: Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing)

#### Maestro Physical Device Testing

Maestro testing in parallel on physical Android and iOS d...

[Read: Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

## Related Articles

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright "Selenium vs Playwright 2026")

### [Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

Comparing Selenium vs Playwright - which is the best test framework for your usecase?

[Read article →](https://testingbot.com/blog/selenium-vs-playwright)

[![Selenium 20th birthday](https://testingbot.com/assets/blog/2024/selenium20.webp)](https://testingbot.com/blog/selenium-20-years "Selenium 20th birthday")

### [Selenium 20th birthday](https://testingbot.com/blog/selenium-20-years)

Celebrate Selenium's 20th birthday. An overview of the years.

[Read article →](https://testingbot.com/blog/selenium-20-years)

[![Selenium WebDriver BiDi](https://testingbot.com/assets/blog/2024/bidi.webp)](https://testingbot.com/blog/webdriver-bidi "Selenium WebDriver BiDi")

### [Selenium WebDriver BiDi](https://testingbot.com/blog/webdriver-bidi)

WebDriver BiDi support is now available on TestingBot. Learn how to use this exciting new improvement with your Selenium tests.

[Read article →](https://testingbot.com/blog/webdriver-bidi)

[![Playwright Testing on TestingBot](https://testingbot.com/assets/blog/2023/playwright-testing.jpg)](https://testingbot.com/blog/playwright-testing-introduction "Playwright Testing on TestingBot")

### [Playwright Testing on TestingBot](https://testingbot.com/blog/playwright-testing-introduction)

Learn how Playwright can run your automated tests on a variety of browsers, local or remote browsers on TestingBot.

[Read article →](https://testingbot.com/blog/playwright-testing-introduction)

## More by Jochen D.

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights "Announcing AI Test Insights")
### [Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

Use AI Insights to quickly discover why an automated test failed.

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing "Maestro Physical Device Testing")
### [Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

Maestro testing in parallel on physical Android and iOS devices.

[![tvOS Physical Device Testing](https://testingbot.com/assets/blog/2025/appletv.jpg)](https://testingbot.com/blog/tvos-automated-testing "tvOS Physical Device Testing")
### [tvOS Physical Device Testing](https://testingbot.com/blog/tvos-automated-testing)

Run automated tvOS tests on physical AppleTV devices.

[See all posts by Jochen D. →](https://testingbot.com/about/jochen-d)

## Ready to start testing?
[Start a free trial](https://testingbot.com/users/sign_up)
