fbpx

How to check the Radio button value if its checked

How to check the Radio button value if its checked

Home Forums Ask Expert How to check the Radio button value if its checked

  • This topic has 1 reply, 2 voices, and was last updated 3 years ago by Sasha ZAP.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32882
    Adil Kamal
    Participant

      I want to know how do we check the radio button value if its checked or no. i have instances where 2 radio buttons are uncecked, i want to know if both are unchecked.

      #32883
      Sasha ZAP
      Moderator

        Hello Adil,
        Basically you do it like this:
        1. Scan the GUI and set object as Image inside the Radio-button.
        2. Use a similar code as the following to determine the actual color of the Radio-button’s inside:
        If the inside color of a Radio-button is white it means the Radio-button is not clicked yet:

        strColorName = Application(“Application”).View(“View”).Object(“RadioButton”).GetAverageColorName
        If strColorName = “WHITE” Then
        Application(“Application”).View(“View”).Object(“RadioButton”).Click ‘Click on the Radio-button if it is not clicked
        End If

        Hope this helps.

        Thanks,
        ZAPTEST Team

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.

      Virtual Expert

      ZAPTEST

      ZAPTEST Logo