Hi guys,
Sometimes it's easier to find (And then write into) an input text field by the text description next to it.
I've been using xpath for that ever since but tried to find a more elegant approach..
The following is a pretty common design..
Tried this. The first element in the array is without a doubt the input element. The thing is, I was not able to use that element in a SetText method for instance...Any ideas ?
Sometimes it's easier to find (And then write into) an input text field by the text description next to it.
I've been using xpath for that ever since but tried to find a more elegant approach..
The following is a pretty common design..
<
table
>
<
tbody
>
<
tr
>
<
td
>Reason waived</
td
>
<
td
>
<
input
id
=
"feeForm:reasonWaived"
type
=
"text"
name
=
"feeForm:reasonWaived"
/>
</
td
>
<
td
/>
</
tr
>
</
tbody
>
</
table
>
Element txtNextTohtmlInputText = Manager.ActiveBrowser.Find.ByContent("Reason Waived");
Element htmlInputTextParent = txtNextTohtmlInputText.GetNextSibling();
htmlInputTextParent.GetChildren().First();//The InputText field.
Element htmlInputTextParent = txtNextTohtmlInputText.GetNextSibling();
htmlInputTextParent.GetChildren().First();//The InputText field.