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:

 AFT Quick Start

 

To do it manually, follow these steps:

  1. Install Python 2.7 (http://python.org/).
  2. Add "C:\Python27" and "C:\Python27\Scripts" to your path.
  3. Install Setup tools from http://pypi.python.org/pypi/setuptools (at the bottom)
  4. Download the latest version of the pip installer script (https://raw.github.com/pypa/pip/master/contrib/get-pip.py)
  5. Open a command prompt and run the script: get-pip.py
  6. Install the Robot Frameworkpip install robotframework
  7. Install the SeleniumLibrarypip install robotframework-seleniumlibrary
  8. Install the Selenium2Librarypip install robotframework-selenium2library
  9. Download the ChromeDriver and place it in "C:\Python27\Scripts".
  10. Download the InternetExplorerDriver and place it in "C:\Python27\Scripts".
  11. Install wxPython (http://www.wxpython.org/)
  12. 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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 

  • No labels