Robot Framework is a generic open-source test automation framework, that is suitable for both end-to-end acceptance testing and acceptance test-driven development (ATDD).
The test syntax for Robot Framework follows a tabular style and plain text format which makes writing test cases more user-friendly and easy to read. Therefore, Robot Framework was found to meet all the required requirements in testing. One of the other benefits of Robot Framework is that it is created in Python which can be implemented on all major platforms.
Among the other open-source tools, Robot Framework appears to be an example of the very few tools that support a multi-platform environment. The test data in Robot Framework is simple, easy-to-edit, so it’s convenient to store in any version of the control system.
Data-Driven Testing is a test design and execution method where the test scripts read data from sources such as XLS, XML and CSV files rather than utilizing hard-coded values. This strategy allows the automation engineers to implement a single test script that can execute tests for all the test data in the table.
The tasks in testing services such as quality assurance sometimes require developers to examine how different “classes” of data will perform in the same test procedure.
A perfect example of this is when a user has to login with their email credentials to access a website. The general way to test this case scenario is to give a valid email and password and then click on the submit button. The expected result is that the user logins to the system under test but there are several negative testing scenarios that needs to be covered as well. Such as:
A) Valid email, invalid password = Error message 1
B) Valid email, blank password=Error message 2
C) Blank email, blank password= Error message 3
D) Unregistered email, valid password= Error message 4
The above scenarios would require a tester to create four different test cases and test each one of those cases individually. Since all the users are effectively following the same procedure, that is, submitting after providing the right email and password; the tester could loop through a series of data values in the same test case and keep track of which one passes the test and which one fails.
Now that we’ve explored some of the ways data-driven tests can benefit in testing, there are other instances as well where data-driven tests are implemented in data setup.
For implementing data-driven tests in data setup, we could use the same concept of iterating through different data rows to do the setup. E.g. When the development team deploys a new instance of an application under test, Jenkins could be used to trigger a particular scenario. This scenario could be a data-driven process executed to register 100 new users into the system under test from an external file like CSV, JSON, or Excel. Therefore, whether you are doing a testing scenario or verifying the different types of users or whether you are doing a data set up, understanding how the robot framework can load up multiple rows of data from the file and process them through 1 test case is a great skill to have.
Here is a typical example of a test automation project that has three separate test cases for testing the negative condition
As you can see:
Here you could see that the test cases do exactly the same test steps, but with different data in each one.
The repeated test steps here are:
Though we could test these scenarios in three different cases, a better approach would be to create a single test case that would say, a negative login scenario should produce correct error messages. This would further iterate through the different sets of the data for the same test step in the first test case. If one of them failed, we wouldn’t exit the test case and simply keep track of the test case and then move on to the next row of data.
Here is a sample program on how you could achieve this
Execute the *.robot program and the HTML results can be viewed as below.
Data-driven tests in robot allow you to view each test data as a separate test case in the log files.
Typically, the built-in method for getting data-driven results in robot framework are as follows
Data-driven testing is a great alternative approach if your enterprise has huge volumes of data to be tested for the same scripts. At ThinkPalm, our test automation services ensure that the quality, reliability, and performance of your product or software is thoroughly verified before it is deployed.
For a free consultation on Testing as a Service (TaaS), Software Testing Services or Test Automation Services.