I have text that says ‘Roles’. After that there are two checkboxes.
I can get to ‘Roles’.
How can I get to and click check the checkboxes?
I am trying to use:
xpath=(//label[contains(text(),'Roles')]/div/span/input)
but getting not found.
My HTML is:
<div class="control-group string required">
<label class="string required control-label" for="survey_name">
<abbr title="required">*</abbr> Name</label>
<div class="controls">
<input class="string required" id="survey_name" name="survey[name]" size="50" type="text" /></div>
</div>
<div class="control-group check_boxes required">
<label class="check_boxes required control-label">
<abbr title="required">*</abbr> Roles
</label>
<div class="controls">
<span class="checkbox">
<input class="check_boxes required" id="survey_role_ids_121" name="survey[role_ids][]" type="checkbox" value="121" />
</span>
</div>
</div>
</div>
The
divis not a child of the label, is is afollowing-sibling. Therefore, the XPath expression you need is