Python Testing: Installing the Robot Framework

Exclusive offer: get 50% off this eBook here
Python Testing Cookbook

Python Testing Cookbook — Save 50%

Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools

$26.99    $13.50
by Greg L. Turnquist | June 2011 | Open Source

The Robot Framework is a useful framework for writing acceptance tests using the keyword approach. Keywords are short-hand commands that are provided by various libraries and can also be user defined. This easily supports BDD-style Given-When-Then keywords. It also opens the door to third-party libraries defining custom keywords to integrate with other test tools, such as Selenium. It also means acceptance tests written using Robot Framework aren't confined to web applications.

This article by Greg Lee Turnquist, author of Python Testing Cookbook, shows all the steps needed to install the Robot Framework as well as the third party Robot Framework Selenium Library.

 

Python Testing Cookbook

Python Testing Cookbook

Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools

        Read more about this book      

(For more resources on Python, see here.)

How to do it...

  1. Be sure to activate your virtualenv sandbox.
  2. Install by typing: easy_install robotframework.
  3. Using any type of window navigator, go to <virtualenv root>/build/robotframework/doc/quickstart and open quickstart.html with your favorite browser. This is not only a guide but also a runnable test suite.
  4. Switch to your virtualenv's build directory for Robot Framework: cd <virtualenv root>/build/robotframework/doc/quickstart.
  5. Run the Quick Start manual through pybot to verify installation: pybot quickstart.html.

    Python Testing Cookbook

  6. Inspect the generated report.html, log.html, and output.xml files generated by the test run.
  7. Install the Robot Framework Selenium library to allow integration with Selenium by first downloading: http://robotframework-seleniumlibrary.googlecode.com/files/robotframework-seleniumlibrary-2.5.tar.gz.
  8. Unpack the tarball.
  9. Switch to the directory: cd robotframework-seleniumlibrary-2.5.
  10. Install the package: python setup.py install.
  11. Switch to the demo directory: cd demo.
  12. Start up the demo web app: python rundemo.py demoapp start.
  13. Start up the Selenium server: python rundemo.py selenium start.
  14. Run the demo tests: pybot login_tests.

    Python Testing Cookbook

  15. Shutdown the demo web app: python rundemo.py demoapp stop.
  16. Shutdown the Selenium server: python rundemo.py selenium stop.
  17. Inspect the generated report.html, log.html, output.xml, and selenium_log.txt files generated by the test run.

Summary

With this recipe, we have installed the Robot Framework and one third-party library that integrates Robot with Selenium.


Further resources on this subject:


Python Testing Cookbook Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools
Published: May 2011
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

About the Author :


Greg L. Turnquist

Greg has worked since 1997 as a software engineer at Harris Corporation, always seeking the right tool for the job. Since 2002, Greg has been part of the senior software team working on Harris' $3.5 billion FAA telco program, architecting mission-critical enterprise apps while managing a software team. He provides after hours support and 2nd-level engineering to support the nation-wide telco network and is no stranger to midnight failures and software triage. In 2010, Greg joined the SpringSource division of VMware.

Being a test-bitten script junky, Greg has used JUnit, TestNG, JMock, FEST, PyUnit, and pMock testing frameworks, along with other agile practices to produce top-quality code.

He has worked with Java, Spring, Spring Security, AspectJ, and Jython technologies and also developed sophisticated scripts for *nix and Windows platforms. Being a wiki evangelist, he also deployed a LAMP-based wiki website to provide finger-tip knowledge to users.

In 2006, Greg created the Spring Python project. The Spring Framework provided many useful features, and he wanted those same features available when working with Python.

Greg completed a master's degree in Computer Engineering at Auburn University, and lives in the United States with his family.

Books From Packt


Python Testing: Beginner's Guide
Python Testing: Beginner's Guide

Python Text Processing with NLTK 2.0 Cookbook
Python Text Processing with NLTK 2.0 Cookbook

Python Geospatial Development
Python Geospatial Development

Python 2.6 Graphics Cookbook
Python 2.6 Graphics Cookbookr

MySQL for Python
MySQL for Python

Python 3 Object Oriented Programming
Python 3 Object Oriented Programming

Spring Python 1.1
Spring Python 1.1

wxPython 2.8 Application Development Cookbook
wxPython 2.8 Application Development Cookbook


No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
E
f
7
P
E
R
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software