java - Click on the dynamic element on table which is in the same row that element with known value -
i have such table
<table class="transaction"> <thead class="transaction"> <tr> <th class="seqtitle" onclick="expandorcollapse('seq2');"> <a name="seq2"> [seq: 2]</a> //dynamic id link </th> <th class="transtitle"> "some known text + other dynamic id" <span class="toolbar"> .... and challenge me click on link dynamic id (in case seq2) when know in same row there element partially known value ("some known text + other dynamic id")
tried xpath following-sibling , preceding-sibling without success cuz dont know how reach dynamically generated link id
ideas?
using preceding-sibling axis could've worked, example :
//table/thead/tr/th[starts-with(., 'some known text')]/preceding-sibling::th[1]/a brief explanation :
th[starts-with(., 'some known text')]: findthelement having text content starts"some known text"/preceding-sibling::th[1]: suchthelements, find nearest preceding siblingthelement/a: each of preceding siblingsthmentioned before, return child elementa
Comments
Post a Comment