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

Extracting variable from input type="hidden"

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ivomir Assi
Top achievements
Rank 1
Ivomir Assi asked on 19 Jun 2013, 10:38 PM
Hello,
This is the input :

<input type="hidden" name="ctl00$SampleContent$ThaiRating_RatingExtender_ClientState" id="ctl00_SampleContent_ThaiRating_RatingExtender_ClientState" value="2">


I want to find the element by id and to extract its value in a variable. How to do it?
This is my approach -> http://screencast.com/t/oplfW5f0d

I'm familiar with C# so if you have any idea how to do it with script step - OK


1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 20 Jun 2013, 02:31 PM
Hello Assi,

This can be done easily in a coded step. After you have added the element to the Element explorer:

SetExtractedValue("myVariable", Pages.MySite.MyHiddenElement.Value.ToString());

See this video for a demonstration.

Hope this helps.
 

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Ivomir Assi
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or