The LEAP

Automation insights and productivity tips from LEAPWORK.

All Posts

Data-Driven Testing With Codeless Selenium

Data is found everywhere. Whether you are testing an application’s functionality with different data parameters or automating the process of moving data from A to B, you have probably realized by now that data is found to be a key component in most automation cases.

In software testing, it is common to find yourself with multiple data sets that you need to run the same tests for. However, creating individual automation cases for each different data set is an extremely tedious and time-consuming task that is almost impossible to maintain in the long run.

If you were to test an application's login system that contains multiple input fields with 800 different data sets, for example, you have three approaches to choose from:

  1. Create one script for each dataset and then run each 800 tests separately
  2. Create a test script and manually change the value each time you run the test. That is, 800 times.
  3. Fetch test data from an Excel file, row by row, and execute the script.

Just by looking at these three approaches, it is easy to see that the first two already seem extensive and laborious. The latter, however, follows a data-driven testing framework, which eases the aforementioned pains by separating the data from the functional tests.

In short, data-driven testing (DDT) allows testers to have one single test script that can then be reused to test all the data in a table or spreadsheet. This especially comes in handy during regression testing, as it allows you to easily test an application with multiple sets of data values.

Recommended reading - A Short Introduction to Data-Driven Testing

DDT in Selenium

The most basic way of creating test cases with data sets in Selenium is by placing the code as well as the data in the same place. However, this is neither re-usable nor readable. In order to do data-driven testing in Selenium, we need to create a data-driven framework that will make code maintenance easier.

Since Selenium doesn’t support data reading of external sources, such as Excel, the framework would need to be supported by a plug-in that would allow us to separate the data set from the test case, making it easy to modify the test cases without having to change the code.

Yet, DDT in Selenium doesn’t eliminate all obstacles. First of all, high-level technical skills are required to create this framework. Secondly, if there’s a change in the application under test, maintenance becomes a burden once more – since large amounts of coding are needed to perform DDT. And lastly, if you get stuck mid-process, you are pretty much left on your own since Selenium doesn't offer 1:1 support.

How to do DDT with codeless Selenium

Even though a data-driven testing framework in Selenium offers an array of benefits, especially when compared to a traditional automation framework, you can still amplify these by doing no-code parameterization of data.

Currently, you can find test automation tools in the market that allow you to get the most of Selenium’s capabilities but through a visual user interface.

LEAPWORK, for example, simplifies DDT by replacing test scripts with visual building blocks – each of them representing a step in the user’s journey. This, in turn, speeds up the whole process and lowers maintenance. How? LEAPWORK’s building blocks represent all the necessary actions and steps upfront while hiding all the code, making it easy for the tester to quickly identify where changes need to be made in a test case.

The following video shows an example on how to use external data from Excel to drive automation cases in LEAPWORK:

 

 

Recommended video – Drive automation with Databases

As shown in the video, LEAPWORK has specific data-driven building blocks to drive automation cases from different data sources, such as Excel, HTTP, or database.

  • HTTP request block: calls a URL with an HTTP/HTTPS request and optionally uses the results in the case.
  • Read Excel: reads and uses data from Excel.
  • Database: reads and uses data from the chosen database.

Recommended video – Drive Automation with Data from Web Services

Moreover, once you are done with your testing, LEAPWORK allows you to write or post back the results of your use cases into some of the aforementioned data sources.

 

If you want to learn how to easily maintain and scale data-driven automation, the codeless way, join our upcoming webinar:

Webinar: Mastering Data-Driven Automation

Lucia Cavero-Baptista
Lucia Cavero-Baptista
Content Marketing Manager

Related Posts

How to Automate Mobile Web Testing with Codeless Selenium

With brick and mortar stores closed during an on-going pandemic, websites, especially e-commerce websites, have to focus more than ever on creating quality customer experiences online. This has created a need for faster testing and new website functionality.

What is Mobile Web Testing and Why Should It Be Automated?

Websites and web applications are a huge part of how businesses acquire customers. Just one poor customer experience can sway their purchasing decision, especially in e-commerce.  Users who have a negative experience on a mobile website are 62 percent less likely to purchase from that business in the future. - Think with Google. 

Streamlining System Upgrades in ServiceNow with Automated Testing

For many enterprise businesses, ServiceNow is an operational backbone. But twice a year, panic unfolds. ServiceNow release two major mandatory upgrades requiring extensive testing. And more often than not, functional and regression testing gets postponed or left behind.  When these tests are postponed or skipped, it leaves businesses open to risk. In these key moments, system administrators and developers face pressure to complete functional and regression testing at speed.