I am not getting how to write script for radio buttons
Printable View
I am not getting how to write script for radio buttons
Hi,
Script for Radio buttons in sense you wish to Check / uncheck radio buttons..??
Well you can script for Individual radio buttons or Create Button Groups to work with the same.
[U]ButtonGroups[/U].
[COLOR="Red"]
Browser("Browser").Page("Page").Frame("Frame").WebRadioGroup("WebRadio").Select "#0"
Where, "#0" is the first radio option
OR
Set appObj = Browser("Welcome To Airtel").Page("Welcome To Airtel").JavaApplet("DefaultJvmDetector").Object.getScriptObject()
Set buttonGroup = appObj.getButtonGroup("group1")
Set buttonObj = buttonGroup.getSelectedButton()
buttonText = buttonObj.getText()
if( buttonText <> "Radio 1" ) then
Reporter.ReportEvent micFail,"Selected Button", "Expected Radio 1.
Acutal is "+buttonText
else
Reporter.ReportEvent micPass,"Selected Button", "Radio 1 is selected."
End if
buttonObj.click
[/COLOR]
We could also descriptive programming to refer to radio buttons. Use the Index property to assist better in recognition.
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “radio_Yes”
obj_Desc(“index”).value= “1”
Cheers.....