jayesh mhatre jayesh mhatre - 3 years ago 274
HTML Question

Selecting radio button when labels are not set in CSS using xpath locator

Not able to select radio buttons using ride (robot framework) for below

tags using
locator in

<div class="controls">
<input checked="checked" data-val="true" data-val-required="The isPdfFormat field is required." id="isPdfFormat" name="isPdfFormat" value="true" type="radio"></input> PDF
<input checked="checked" id="isPdfFormat" name="isPdfFormat" value="false" type="radio"></input> CSV

Rao Rao
Answer Source

Please check the below xpath:
//input[normalize-space(following-sibling::text())='CSV' and @id='isPdfFormat']

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download