Forum Discussion

MMZ's avatar
MMZ
Occasional Contributor
24 days ago

Handling Radio Buttons Using If–Then in TestComplete Keyword Testing

Kindly review and guide me on how to handle if…then conditions in Keyword Testing.

My application under test contains radio buttons. Please guide me on how to configure the If…Then operation when:

Value 1 is based on object identification

What should be defined in Value 2 for proper condition evaluation?

Additionally, please advise which method is best for handling these radio buttons in Keyword Testing, as shown in the attached screenshot.

13 Replies

  • MMZ's avatar
    MMZ
    Occasional Contributor

    It was another matter.

    Now, I'm stuck in if...then with onscreen object. I have chosse the radio button i.e., "falsematch" and confused what will be in value 2?

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    You have three radio buttons as shown in your screenshot. What exactly do you want to perform -

    1. Do you want to select a radio button?
    2. Do you want to check which radio button is selected?
    3. Do you want to check the names of each radio buttons?

     

    • MMZ's avatar
      MMZ
      Occasional Contributor

      I wanted to apply check if radio button of falsematch is selected then execute the child operation which is 'Next button' if falsebutton not found the execute Else...

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        To check to see if "False Match" radio button is selected, what property value have you chosen to indicate that the radio button is selected?

        As an example, for a Bootstrap Radio Button, the property name wChecked having a value of true, indicates that the radio button is selected.

         

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 3 rankChampion Level 3

    If value 1 "object property example checked" equal value 2 "true"

    👍 Found it helpful? Click Like
    ✅ Issue resolved? Click Mark as Solution

    • MMZ's avatar
      MMZ
      Occasional Contributor

      Already did the same but it's always execute the else statement regardless it's true and false.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        Any response to this?

        To check to see if "False Match" radio button is selected, what property value have you chosen to indicate that the radio button is selected?