Reputation: 19
I would like to get a label value and pass it to a variable. Let's say I have:
<td class="label">
<label for="id5">**Text value**</label>
How can I pass string "Text value" to a variable? I tried:
string a = ie.Label(Find.ByFor("id5")).ToString();
but it doesn't get any value...
Upvotes: 1
Views: 670
Reputation: 11955
You should use the Text-property (Gets the innertext of the element and the innertext of all the elements contained in the element.):
string a = ie.Label(Find.ByFor("id5")).Text;
Upvotes: 2