Table of Content
Robot Framework is an automation framework for acceptance testing. It empowers testers to automate and manage complex workflow scripts efficiently. Its testing capabilities can be enhanced by test libraries implemented either with Python or Java. Robot framework uses selenium library as a testing tool to test web applications internally.
The features given below ensure that testing is done in a quick and proficient fashion.
- Simple tabular.
- Easy to create Data-driven and Keyword-driven test cases.
- Separate test data editor, RIDE – a light-weight and intuitive editor for writing test case files.
- Clear reports and detailed logs.
- Generic test libraries.
Let’s create a test case using selenium2 library in Robot Framework. We will see how the user is able to enter an application using Robot framework.
What we need to do:
- Create a project in RIDE.
- Communicate with web application and read elements from web application using selenium2 library.
- Enter values in the application, and log in using RIDE.
- Generate auto HTML report and log.
Before solving our use case, let’s get some pre-requisites satisfied.
- Install an interpreter Python 2.7, from this link – http://www.python.org/download/releases/2.7.6/
- Install robot framework from this link – https://code.google.com/p/robotframework/downloads/list
- Install Selenium2 library from this link – https://pypi.python.org/pypi/robotframework-selenium2library
- Install wxpython, a GUI toolkit for python programming language – http://www.wxpython.org/download.php
- For advanced Windows-specific support, install pywin32 - http://sourceforge.net/projects/pywin32/
- Install RIDE, a special editor for Robot framework – https://pypi.python.org/pypi/robotframework-ride
Create a new project in Robot Framework (using RIDE):
- Create a New project using RIDE inside a directory.
File –> New Project
- Add a test suite file under the above created project.
right click on new project –> Test suite
- Add library selenium2 in test suite file using library button.
- Open test suite in edit panel and click library button.
- Add library name in Name field inside library panel.
- Library should be named as Selenium2Library (library name is case sensitive)
- Add new test cases with test suite and create user keywords for the test case.
- Define all user defined keywords.
- Right click on test file and click on add new user keyword,named – Open application.
- Give the keyword as “Open application” ,it will get added.
- To open URL, add the predefined keywords in a table and its corresponding values.
- Similarly, repeat the process for other user defined keywords.
- Now to run test case , check the test case and click on run button.
- Report is generated, automatically. Click the Report button in Run panel.
- It is simple to create test case using RIDE.
- RIDE gives output quickly in HTML format automatically.
- We can easily communicate with Python and selenium2 library.
- Automation testing of web applications is comfortable and easy to use.
- Robot Framework user guide – http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.8.4
- Selenium2Library user guide – http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html