Forum Discussion

RichBopp's avatar
RichBopp
Contributor
8 years ago

KeyWord Mode: Is there a way to create conditional checkpoints?

Keyword Mode: Is there a way to create conditional checkpoints? 

 

I have a test - which depending on the country I'm testing - will produce 3 different results in a Property Checkpoint I set up. All are valid, but I can only check one. 

 

I thought there would be a method in Operation Parameters around 'Value', something like the Value can equal "A101 or A102 or A103", but no such luck.

 

 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    If I got your question right: as per http://support.smartbear.com/testcomplete/docs/keyword-testing/reference/checkpoints/property.html and http://support.smartbear.com/testcomplete/docs/reference/program-objects/aqobject/checkproperty.html, you may use either cmpIn condition or the cmpMatches one.

    In the former case you should check against "A101,A102,A103" expression, while in the latter case - against "A10[1-3]" one (might require correction).

    • RichBopp's avatar
      RichBopp
      Contributor

      Alex, 

       

      The 'cmpIn' solution you suggested worked perfectly.  Thank you very much, sir.

       

      I'm new to TestComplete, and I am thankful for the quick reply.  You are indeed a 'Community Hero'.

       

      Kudos,

       

      Rich

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I don't think so.  Would be a cool idea.... 

     

    However, what you could do is use the "If--then" operator.  Just set up three if--then conditionals and do something where

     

    if country = a then checkpoint on value A101

    if country = b then checkpoint on value A102

    if country = c then checkpoint on value A103

     

    • RichBopp's avatar
      RichBopp
      Contributor

      Martin,

       

      Alex's suggestion worked for me, but I wanted to respond to you as well.  I will be experimenting with IF/Then next week on some other tests.  I will try your solution then as well. 

       

      I can see yours as providing more precise control, and will let you know.

       

      Thank you,

       

      Rich