Results 1 to 2 of 2

Thread: Script for Radio Button

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Script for Radio Button

    I am not getting how to write script for radio buttons


  2. #2
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact