-
Junior Member
Script for Radio Button
I am not getting how to write script for radio buttons
-
Expert Member
Re: Script for Radio Button
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.
ButtonGroups.
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
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.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules