11.Data from an array can be used in recorded steps and code behind methods. To bind data from a data array to a recorded step, continue to the next step. To use reference data from the data array in a code behind method, skip to step 19.
12.Highlight step 2. This is the recorded step that sets the value of the Google search text box.
13.The properties for this step appear in the Properties pane, located on the right of the screen.
14.Click the '...' button for (Bindings).
15.Choose the 'Numbers' from the drop down for Text.
16.Click the Set button.
17.The data for the column named Numbers from the data array is now bound to the Text property for that step. Instead of entering Telerik into the search box, the data stored in the array will be entered.
18.Save and execute the test. Note that the test will execute for each row in the data array, for a total of five iterations.
19.To use reference data from the data array in a code behind method, follow the below directions:
20.Highlight step 2. This is the recorded step that sets the value of the Google search text box. Right click the step and select Customize Step in Code.
21.Choose Visual Basic or C#.
22.Use the Data property followed by the index of the column to reference data from the grid. For example:
//Reference a column by name
Pages.Bing.SbFormQText.Text = Data["Numbers"].ToString();
//Reference a column by index (zero based)
Pages.Bing.SbFormQText.Text = Data.ToString();
'Reference a column by name
Pages.Bing.SbFormQText.Text = Data("Numbers").ToString()
'Reference a column by index (zero based)
Pages.Bing.SbFormQText.Text = Data(0).ToString()
23.Save and build project.
24.Execute your test. Note that the test will be executed for each row in the data array.