I'm attempting to click a checkbox based on it's adjacent text. However the pages structure is making it rather difficult. The problem is things are nested in tables nested in divs and so on. The section of code in question looks like this:
<tr id="yui-rec62" class="yui-dt-first yui-dt-even" style="">
<td class="yui-dt25-col-access yui-dt-col-access yui-dt-first" headers="yui-dt25-th-access ">
<div class="yui-dt-liner">
<input id="functionId13" type="checkbox" value="13" name="functionId">
</div>
</td>
<td class="yui-dt25-col-name yui-dt-col-name yui-dt-last" headers="yui-dt25-th-name ">
<div class="yui-dt-liner">Ability to Add/Remove Queues</div>
</td>
</tr>
I need to be able to find the div containing Ability to Add/Remove Queues
by way of the input with the ID of functionId13
. This is resulting in a check like this:
if(div has text of "Ability to Add/remove Queues"){
return the WebElement of the check box associated with it
}
I have a list of all the checkboxes and their IDs, I just can't come up with a way to match them up with their descriptive text.