Below is the html for two check boxes, and my intention is to select a checkbox using it's label as 'XERU' or 'SYM'. In Robot Framework, the keyword 'Checkbox Should Be Selected' uses Key attributes; ID and name as it's locator, but here ID is dynamic for each label.
So I need to frame an Xpath for the check box selecting it's ID / Name but not to be hard coded within the test suite.
<input id="ctl00_PageBody_chklistVirtualAddressingGroups_5" name="ctl00$PageBody$chklistVirtualAddressingGroups$5" type="checkbox"/>
<label for="ctl00_PageBody_chklistVirtualAddressingGroups_5">XERU</label>
<br/>
<input id="ctl00_PageBody_chklistVirtualAddressingGroups_6" name="ctl00$PageBody$chklistVirtualAddressingGroups$6" type="checkbox"/>
<label for="ctl00_PageBody_chklistVirtualAddressingGroups_6">SYM</label>
<br/>
You can try the following code. This code is based on HTML you provided. Please try to provide more information.