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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -