Replacing Recorded Values โ€‹โ€‹with a Data File - Data Driven Testing

I wrote down a simple Coded UI test from visual Studio 2013. What it does is:

  • Launches the website
  • Fills in a form with (8 fields)
  • Saves the form and closes it

Now I want to use a file data.csv

to replace these 8 values. All the searches I did, I could only find options where each input field had a different method, so it was easy to find and replace the values. In my case, 1 method and 8 fields.

How should I do it? Where can I make the change as my main file looks like this:

enter image description here

Where and what changes should I make to use the CSV file instead of the manual values โ€‹โ€‹I wrote down.

My designer file code is below for multiple input fields:

// Type '123456789' in 'i' text box
uIIEdit.Text = this.createKundeParams.UIIEditText; 

// Type '{Tab}' in 'i' text box
Keyboard.SendKeys(uIIEdit, this.createKundeParams.UIIEditSendKeys, ModifierKeys.None);

// Type 'Jeff Hardy' in 'name_i' text box
uIName_iEdit.Text = this.createKundeParams.UIName_iEditText;

// Type '{Tab}' in 'name_i' text box
Keyboard.SendKeys(uIName_iEdit, this.createKundeParams.UIName_iEditSendKeys, ModifierKeys.None);

      

+3


source to share


1 answer


you can put all 8 values โ€‹โ€‹in 1 csv line and treat them as one input to be passed to the method that sets the fields, alternatively you can change the method to accept one value and the field name and sets the field with a value



+1


source







All Articles