Robot Framework
Abstract
Robot Framework is an open source generic test automation framework for acceptance testing and acceptance test-driven development. It provides support for Selenium tests, which makes it very suitable for testing websites. This topic describes how to install and use the Robot Framework and its ecosystem software.
Installation
To install the Robot Framework you can copy and extract the following file: W:\QA\TestAutomationGX.zip
Now you just have to add some directories to your path. See for further instructions:
/wiki/spaces/GXAR/pages/25002579
To do it manually, follow these steps:
- Install Python 2.7 (http://python.org/).
- Add "C:\Python27" and "C:\Python27\Scripts" to your path.
- Install Setup tools from http://pypi.python.org/pypi/setuptools (at the bottom)
- Download the latest version of the pip installer script (https://raw.github.com/pypa/pip/master/contrib/get-pip.py)
- Open a command prompt and run the script:
get-pip.py
- Install the Robot Framework:
pip install robotframework
- Install the SeleniumLibrary:
pip install robotframework-seleniumlibrary
- Install the Selenium2Library:
pip install robotframework-selenium2library
- Download the ChromeDriver and place it in "C:\Python27\Scripts".
- Download the InternetExplorerDriver and place it in "C:\Python27\Scripts".
- Install wxPython (http://www.wxpython.org/)
- Install RIDE (https://github.com/robotframework/RIDE)
When everything is installed, execute the following commands:
pybot
and then
ride.py
Hello World Test
To see if everything is functioning correctly, edit a test suite file named hello_world.txt
:
*** Settings *** Library Selenium2Library timeout=10 seconds run_on_failure=Capture page screenshot *** Variables *** ${BROWSER} firefox ${DELAY} 0.5 seconds *** Keywords *** Open browser to Google homepage Open browser http://www.google.com/ ${BROWSER} Set selenium speed ${DELAY} Capture page screenshot Close browser *** Test cases *** Hello world Open browser to Google homepage
Save the file, then execute the command:
pybot hello_world.txt
Or, alternatively, start up RIDE, open the test suite file and run the test.
Troubleshooting
In general, the error messages in the Robot Framework are very descriptive and often contain the solution to your problem. Be sure to read the output well. When testing with Internet Explorer 7 or higher, make sure you set the "Enable Protected Mode" setting (under "Internet Options > Security") to the same setting for each zone. It does not matter whether it enabled or disabled as long as it is the same setting for all zones.
Further reading
More information on Robot Framework and Selenium can be found in the links below.