Angelin Burtea
Angelin Burtea

Reputation: 11

Select radio button with robotframework

I am trying to select a radio button using Robotframework(Python2.7,Selenium2Library).

I have the following code:

<div id="dt_method_cashondelivery" class="u-border-b-dotted u-space-pt-10                                                       
 u-space-pb-5">
     <input id="p_method_cashondelivery" class="Form-check-toggle"  
 type="radio"title="Cash On Delivery" name="payment[method]"           
 value="cashondelivery"/>
     <label class="Form-radio" for="p_method_cashondelivery">
         <span>Cash On Delivery </span>
     </label>
 </div>

The Robot Framework code I am using is:

Select Radio Button    payment[method]    cashondelivery

Any ideas?

Upvotes: 0

Views: 3386

Answers (1)

Akash W
Akash W

Reputation: 371

Use below keyword

Click Element    jquery=#p_method_cashondelivery

OR

Click Element    css=#p_method_cashondelivery

If you are locating element using id attribute then precede it with '#' and if you are locating element using class then precede with '.'

Upvotes: 1

Related Questions