Hi All,
I've been to the xpath tutorial sites:
http://www.zvon.org/xxl/XPathTutorial/Output/example11.html
and
http://www.w3schools.com/xpath/
and it seems that all of their syntax examples are simple ones.
(it's almost like we need an xpath forum on here)
what I'm trying to do is to select an input text box when all of its unique attrributes may be different every time I run the test because the page is created dynamically. What i know is that the input field is located inside a TD and that the preceeding TD will contain a link whose text is "Update".
here's a snippet of the page
<td>
<a href="javascript:__doPostBack('dtgSteps$_ctl5$_ctl0','')" style="color:threeddarkshadow;">
Update
</a>
<a href="javascript:__doPostBack('dtgSteps$_ctl5$_ctl1','')" style="color:threeddarkshadow;">
Cancel
</a>
</td>
<td align="center">
<input name="dtgSteps:_ctl5:_ctl2" type="text" style="width:100px;" />
</td>
<td align="center">
<input name="dtgSteps:_ctl5:_ctl3" type="text" style="width:100px;" />
</td>
and here's what i tried
//a[contains(text(),'Update')]/parent::td::following-sibling/input[@type='text']
first off - I'm not sure that i'm using the text() function correctly... how do you specify an "a" tag which has a text node containing some text "Update"
second - I'm not sure how to reference a parent TD's Following sibling's child (ha that's a cousin... )
the selenium error i got is:
The expression is not a legal expression.
my question... What is a legal expression for my first following cousin 'input' element of an 'a' element with a text node containing 'Update'