Given this HTML\[code\]<ol> <li id="topic_roles_input"> <fieldset class="choices"> <input id="topic_roles_none" name="topic[role_ids][]" type="hidden" value="" /> <ol class="choices-group"> <li class="choice"> <label for="topic_role_ids_107"> <input id="topic_role_ids_107" name="topic[role_ids][]" type="checkbox" value="http://stackoverflow.com/questions/13715846/107" />Language Therapist </label> </li> <li class="choice"> <label for="topic_role_ids_106"> <input id="topic_role_ids_106" name="topic[role_ids][]" type="checkbox" value="http://stackoverflow.com/questions/13715846/106" />Speech Therapist </label> </li> </ol> </fieldset> </li></ol>\[/code\]I can select the first checkbox with:\[code\]xpath=(//li[contains(@id,'topic_roles_input')]//input[@type="checkbox"][1])\[/code\]But I can't select the second with:\[code\]xpath=(//li[contains(@id,'topic_roles_input')]//input[@type="checkbox"][2])\[/code\]How can I select the second checkbox, avoiding using the 106 / 107 id's (this is being used for repeated tests).