Selenium IDE with XPath to identify cell in table based on other column -


please take @ snippet of html below:

<tr class="clickable"> <td id="7b8ee8f9-b66f-4fba-83c1-4cf2827130b5" class="clickable"> <a class="editlink" href="#">single</a> </td> <td class="clickable">£14.00</td> </tr> 

i'm trying assert value of td[2] when td[1] contains "single". i've tried assorted variants of:

//td[2][(contains(text(),'£14.00'))]/../td[1][(contains(text(),'single'))]

i've used similar notation elsewhere - no avail here... think it's down td[1] having nested element, not sure.

can enlighten i'm getting wrong? :)

cheers!

what about:

//tr[contains(td[1], "single")]/td[2] 

first select <tr> containing <td> matching text, , select td[2].

then,

contains(//tr[contains(td[1], "single")]/td[2], "£14.00") 

should return true.

or, closer expression tried, test if matches:

//tr[contains(td[1], "single")]/td[2][contains(., "£14.00")] 

see @jenserat's answer find xth td td contains in same tr xpath python .


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -