2

The recorder works fine for quickly getting some steps thrown down, but I need to be able to store and set arbitrary text. Let's say I generated a new admin user called Admin001. I want to be able to set the text for the control to be "Admin001", not whatever was recorded when I first used the builder.

I know you can do data bindings to CSV and the like, but that's too burdensome. I want to be able to write C# code to change which text is typed.

Screenshot:

enter image description here

Code attempt:

            var loginElement = new UILoginInternetExploreWindow().UILoginDocument.UIUserNameorEmailAddreEdit.Text;

So I'm able to get the property .Text (I think), but not actually set it...

Aaron
  • 2,154
  • 5
  • 29
  • 42
  • Read http://stackoverflow.com/questions/23469100/how-to-run-a-test-many-times-with-data-read-from-csv-file-data-driving/25742114#25742114 , concentrate on the part after "**Read the CSV fields and use them in the test**". – AdrianHHH Jun 23 '15 at 08:02

1 Answers1

3

to set the property just do:

new UILoginInternetExploreWindow().UILoginDocument.UIUserNameorEmailAddreEdit.Text = 
"Some Text";

or:

var loginControl = new UILoginInternetExploreWindow().UILoginDocument.UIUserNameorEmailAddreEdit;
loginControl.Text = "Some Text";
barakcaf
  • 1,294
  • 2
  • 16
  • 27