Functional Testing – Using Robot Framework

Functional Testing – Using Robot Framework

Introduction

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.

Use Case

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.

Solution

Before solving our use case, let’s get some pre-requisites satisfied.

Pre-requisites:

Create a new project in Robot Framework (using RIDE):

  • Create a New project using RIDE inside a directory.

File –> New Project

1

  • Add a test suite file under the above created project.

right click on new project –> Test suite

2

  • 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)

3

  • Add new test cases with test suite and create user keywords for the test case.

7

    • 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.

4

  • 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.

8

  • Report will be generated in HTML format.Attr test report

Conclusion

  • 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.

Reference

 

5461 Views 2 Views Today