Submit a Blog
Member - { Blog Details }

hero image

blog address: https://appsierra.com/data-driven-testing

keywords: Technology ,Application ,Software , Internet

member since: Oct 23, 2021 | Viewed: 503

Get In The Driver’s Seat: Learn All About Data-Driven Testing

Category: Technology

Appsierra Data-driven testing is an approach for software testing in which test data is stored in a table or spreadsheet format. It also allows testers to input a single test script that could execute tests for all test data from a table and expect the test output in the same table. Data-driven framework The data-driven framework is an automation testing framework in which input values are read from data files and stored in two variables in test scripts….Learn more Why is data-driven testing important? Data-driven testing is important because testers typically have several collections of data for a single test, and it can be very time consuming to construct individual tests for each set. Data-driven testing helps us in keeping data separate from test scripts…..Learn more Example: Here is an example of doing so if we want to test the login system with multiple input fields with a thousand different data sets. We can take the following different approaches for testing this. Approach 1 Create 1000 scripts, one for each data set, and run each test separately one by one. Approach 2 Manually adjust the value in the test script and run it several times. Approach 3 Importing data from the Excel sheet. Fetching test data from Excel rows one by one and executing the script. In the given scenarios, the first two hours are laborious and time-consuming…..Learn more How to create a data-driven automation framework? Let’s consider that we want to test the login functionality of an application: Step 1. Identifying test cases. • Input Correct username and password – Login Success • Input incorrect username and correct password – Login Failure • Input correct username and incorrect password – Login Failure Step 2. Creating detailed testing Steps for the 3 test cases above…..Learn more Test Case Description Test Steps Test Data Results Expected 1 Checking Login for valid credentials Launching the applicationEntering Username passwordClick on OkayCheck Results Username: valid password: valid Login Success 2 Checking Login for invalid credentials Launching the applicationEntering Username passwordClick on OkayCheck Results Username: invalid password: valid Login Fail 3 Checking Login for invalid credentials Launch the applicationEnter Username passwordClick OkayCheck Results Username: valid password: invalid Login Fail Step 3. Creating a test script. If we observe, the test steps remain common throughout the test steps. It will help if we created a test script for executing this step. // This is Pseudo Code // Test Step 1: Launch Application driver.get(“URL of the Application”); // Test Step 2: Enter Username txtbox_username.sendKeys(“valid”); // Test Step 3: Enter Password txtbox_password.sendKeys(“invalid”); // Test Step 4: Check Results If (Next Screen) print success else Fail Step 4. Creating an Excel/CSV with the input test data. Step 5. Modifying the script for looping over input test data. The input commands are also required to be parameterized. // This is Pseudo Code // Loop 3 Times for (i = 0; i & lt; = 3; i++) { // Read data from Excel and store into variables int input_1 = ReadExcel(i, 0); int input_2 = ReadExcel(i, 1); // Test Step 1: Launch Application driver.get(“URL of the Application”); // Test Step 2: Enter Username txtbox_username.sendKeys(input_1); // Test Step 3: Enter Password txtbox_password.sendKeys(input_2); // Test Step 4: Check Results If(Next Screen) print success else Fail } The three cases above are the ones that the test script could use to loop over the following test cases by appending test data values to excel….Continue reading



{ More Related Blogs }
Success, Pitfalls and Getting Metaverse Right in 2023

Technology

Signs of Anxiety in Children and How to Deal with it Using WhatsApp Spy App

Technology

Travel XML API Integration

Technology

API Travel Agency

Technology