jayesh mhatre jayesh mhatre - 3 years ago 249
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

HTML
tags using
xpath
locator in
robotframework
.

<Pre>
<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
</div>
</Pre>

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