Single Data vs Multiple Data in a Row
The way you structure your CSV and parameterize your test steps depends on the test scenario.
Types of dataset depends on your use cases:
Single Data in a Row: Each row contains a unique set of data for one test run (e.g., login credentials).
Multiple Data in a Row: A single cell in a row contains multiple data points separated by a delimiter (e.g., adding multiple items to a shopping cart in one test run).
Use Case 1: Single Data in a Row (Login Credentials)
This is the most straightforward use case. The test will execute one full time for each row.
CSV Structure (
credentials.csv
): Each row is a complete, independent test scenario.
Scenario,UserName,Password
Invalid,hello@fhf.hh,dddd
Valid,hello@fhf.hh,4566hj
Valid,hi@gmail.com,34rgth
Test Logic:
Iteration 1 uses the "Invalid" row.
Iteration 2 uses the first "Valid" row.
Iteration 3 uses the second "Valid" row.
Parameterized Steps:
Enter text "{{dataset.UserName}}"
Enter text "{{dataset.Password}}"
Use Case 2: Multiple Data in a Row (Multiple Items in a Cart)
This is for scenarios where a single test iteration needs to handle multiple pieces of data. We use a delimiter (|||
in this case) to pack multiple items into a single cell.
CSV Structure (
multi_add_to_cart.csv
):Scenario,search_tags,item_name,qty Scenario 1,ludo|||Color Pencil|||Kiwi Fruit,Board Game|||Pencil Set|||Fresh Kiwi,2|||2|||2
Test Logic: The entire repeat block runs once for "Scenario 1". The test step that receives the data must be able to handle the delimited string.
Parameterized Step:
Enter text "{{dataset.search_tags}}"
In this step, the value passed during the run will be the complete string:
"ludo|||Color Pencil|||Kiwi Fruit"
.The application under test or subsequent test steps must be designed to process this delimited input.
Last updated