Re: Radio Buttons.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Radio Buttons.

GW-5
You can use //input[@type='radio' and @name='tripType' and @value='OWT']

But I recomend giving both options a separate id. That would greatly help adding a <label>!

ie. id="tripType_RT" and id="tripType_OWT"  Or something like that..
You can use those as ElementLocators for the click command and you can change your optionlabels to <label for="tripType_RT">Round Trip</label> and <label for="tripType_OWT">One Way</label> to make them clickable too.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=984&messageID=2769#2769

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Radio Buttons.

Mike Williams-7
Satish Kaushik wrote:

>I am using Selenium 0.6.0 to automate clicking of two radio buttons and here is the JavaScript
>snippet :
>
>      <input type="radio" name="tripType" value="RT" onClick="changeTripTypeRadioButton(this.form.tripType);" id="tripType"
>      Checked /> Round Trip
>      <input type="radio" name="tripType" value="OWT" onClick="changeTripTypeRadioButton(this.form.tripType);" id="tripType"/>
>      One Way
>
>Since the Round Trip is checked by Default, I am trying to get the OWT radio button clicked.
>  
>
For what it's worth, with the SVN (unreleased) version of Selenium, you can

    | check | tripType value=OWT | |

With the released version (0.6.0), XPath is probably as good as you'll
get (and the "check" command doesn't exist).

    | click | //input[@name='tripType' and @value='OWT'] | |

--
cheers, MikeW                            http://www.dogbiscuit.org/mdub/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]