Forum Discussion

MW_Didata's avatar
MW_Didata
Regular Contributor
3 years ago

Property Checkpoint posting a warning

Hi I would like a property checkpoint to post a warning not an error, i just want to know if this is possible or if it is locked as an error?

As seen in attached image, those errors fail the test, however if the first one fails i want it to be a warning, the second error is fine.

 

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      When reading this page all I'm getting is that it is not possible to post a warning?

      If so then is there another check i can use that can read an onscreen property and when incorrect post a warning?

       

      Thanks for the help!

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The Property Checkpoint Alternatives for example is,

     

     

    function test1()
    {
        x = 1
        y = 2
        
        // Implement custom verification logic and post custom success and failure messages to the test log
        if (x == y) {
            Log.Message("X equals to Y");
        } else {
            Log.Warning("X not equal to Y");
        }
        
        // Or use property checkpoint to verify object’s property value according to a certain condition
        aqObject.CompareProperty(x, cmpEqual, y, false, lmWarning);
    }

     

     

     

    • MW_Didata's avatar
      MW_Didata
      Regular Contributor

      Okay so About Property Checkpoints, was actually the right call.

      • To compare the actual and expected property values, use the if … then … else statement and comparison operators such as =, >, >=, <, <= and so on. This way, you can implement custom verification logic and post custom success and failure messages to the test log.

      So i used the Compare property instead and that has fixed my problem. thanks for your help