Forum Discussion

romanmfs's avatar
romanmfs
Frequent Contributor
7 years ago

Problem with checkboxes

HI all!

 

I am using keyword tests. 

I have created a table in TC to pull data to fill in forms on a website (screenshots attached).

Every round will pull different row of data to fill in the fields. 

 

Problem I am having:

there are checkboxes which have to be clicked every round differently.

What I planned is to assign values such as true or false or 1 or 0 to the checkbox property (makes sense no?)

so every time TC runs the row from the table it will click the checkbox (true) or will skip (false).

However that just dont work. I do not get an error code of any type. Testcase just always seems to pick same checkboxes no matter if the table value assigned is (true or false or 1 or 0 or left or right)

 

 

Am I on the right track, any idea what I am doing wrong?

Thanks a bunch.

 

PS: I am only working in keyword testing. 

See screens

9 Replies

    • romanmfs's avatar
      romanmfs
      Frequent Contributor

      Thank you for quick reply.

      How do I check if my table variable are string values?

       

      I am new to scripting, do I create a new scrip like this and just add it on top of my keyword test?..

       

      function VarToBool()
      {

      // Converting strings to Boolean values
      Log.Message(aqConvert.VarToBool("TRuE"));
      Log.Message(aqConvert.VarToBool("false"));
      }

       

      Thanks

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        in the lines where you are using ClickChecked, for instance

         

        checkboxPhonerequested     ClickChecked    Project.Variables.YourObjectStuffIsHere

         

        you can point over to the right of the Project.Variables part and you will see a box with three dots  ...

        open that up and instead of choosing an object you can use Code Snippet

        then you can put this as the parameter for ClickChecked 

         

        aqConvert.VarToBool(Project.Variables.YourObjectStuffIsHere)

         

         

        so now your test will look something like

         

        checkboxPhonerequested     ClickChecked    aqConvert.VarToBool(Project.Variables.YourObjectStuffIsHere)