Forum Discussion

Cartographer7's avatar
Cartographer7
New Contributor
8 years ago

How to reverse the results of a checkpoint, so it fails when it would normally pass and vice versa?

I'm currently on a free trial of TestComplete, and couldn't figure out how to do this. I'd like to know how to do this in general, although in my specific case, I'm just trying to get an exact match on a region checkpoint to fail instead of pass.

 

 

9 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    I could not grasp/imagine what you are trying to achieve..?

     

    To get exact revers you need to change logic of your test (I assume you are doing KDT)

    eg X==Y change to X!=Y

    In scripting simply change Log.Checkpoint() to Log.Error()

     

    if you need to fail a region just include a region that dose not exist.

     

    I hope forum could help you if explain the scenario you are going through................... 

    • Cartographer7's avatar
      Cartographer7
      New Contributor

      I'm trying to check a value after it is entered in a text field and make sure it does not equal zero; any other value is acceptable. Unfortunately, for some reason the entered value isn't visible as a property I can check with a property checkpoint. (And yes, I have it set to show hidden members.)

       

      So instead I'm trying a region checkpoint, comparing the field against an image of the field with a zero entered. This works, except that I need the opposite result. I've tried adding a ! operator to the line to reverse the boolean result, but apparently the boolean result of the checkpoint method isn't what determines if the test passes or not.

       

      This is the line in question:

      Regions.DEdt_Quantity3_Masked.Check(Aliases.Lubeit5.fmain5.MDIClient.Ftrigger.Pnl_Interval.DEdt_Quantity, false, false, 0, 0, "DEdt_Quantity3_Masked_Mask");

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        We should be able to find that text value for you.  Could you show us the Object Spy screen for the text box?