Installing the Robot Framework

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 recipe shows all the steps needed to install the Robot Framework as well as the third party Robot Framework Selenium Library for use by later recipes.

How to do it...

  1. Be sure to activate your virtualenv sandbox.
  2. Install by typing: easy_install robotframework.

    Note

    At the time of writing, Robot Framework was not able to be installed using pip.

  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.
    How to do it...
  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.
    How to do it...
  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.

There's more...

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

There are many more third-party libraries that provide enhanced functionality to the Robot Framework. The options have enough potential to fill an entire book. So we must narrow our focus to some of the core features provided by Robot Framework, including both web and non-web testing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.167.183