This is a migrated thread and some comments may be shown as answers.

Actions.SetTest as a variable

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 16 Aug 2013, 09:44 AM
Hi,

I am trying to set some test in a text box on a gridview, the textbox will be different on each test so i need to set the element name on each text,
int no = Row.RowIndex;
string textbox = "Pages.ERecruitment7.ContentPlaceHolder1GvLookupTxtengagementStatus"+no.ToString()+"Text";
 Log.WriteLine(textbox);
 Actions.SetText(textbox, "AAA_Test Studio_BBB");

This is what i have so far (simplified), i am assumed i could set the string and then replace the target element, but i says it cannot be a string, is there a way i can do this? create a new target element?

Thanks

1 Answer, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 21 Aug 2013, 08:20 AM
Hi Joseph,

Unfortunately you can't switch the name of the element with a string in the Action.SetText() arguments. 

The best way to handle this testing scenario is to locate the required element (textbox) with code and that way you won't need the elements from the Elements Explorer.
You can read in our documentation how you can find the element with code.

I will be happy to assist you,  if you need additional help.  

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Joseph
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question
or