Let's create a new, Local Data Driven test. We'll go through five iterations of the test, each with a different search text.
1.Create a new Web Test and click Record.
2.Navigate to www.google.com, enter Telerik in the Google search box, and hit the Search button.
3.Click the Pause recording button in the Recording toolbar.
4.Click the Data tab in the current test.
5.There are few buttons at the top of this pane and at this point only Create a new data table is enabled. Click it to add a new data grid.
6.The default grid will have five columns and a single row. Also the rest of the buttons get active and allows you to modify the grid.
- Set number of rows and columns (columns are limited to 50) and update the grid
- Create new data table or remove current data table - both options inform that the current data is deleted if you go ahead
- Add a row/Delete the last row or Add a column/Delete the last column
Add/Delete Row |
Add/Delete Column |
7.For this example we want to execute five iterations of the test entering different search text for each iteration. Therefore modify the table to have a single column and 5 rows and click on Update.
8.Enter random values in each of the cells in that column. Right click Col1 and choose Rename Column to enter a meaningful to you name for the column. Then save the modified test.
9.Get back to the Steps tab and select step 2. This is the recorded step that sets the value of the Google search text box and open its properties in the Properties pane.
10.Click the '...' button for the (Bindings) property and select the column name created in the local data to set it for the Text property of the selected step. Click the Set button.
The data for the column in the local grid is now bound to the Text property for the 'Enter text' step. Instead of entering Telerik into the search box, the data stored in the data table will be entered. Save and execute the test. Note that the test will be executed for each row in the data table, for a total of five iterations.