Forum Discussion

autoguy1's avatar
autoguy1
Occasional Contributor
4 years ago

Can you manually for a checkpoint in the log for anything?

Let me give my scenario to make this more clear. Currently I have a situation when I am exporting a report to a CSV, creating a list of all data from that CSV and comparing it to an expected list. 

 

Currently I have something along the lines of:

if list_a == list_b:

     Log.Message("The two lists match")

It is more complex than this but basically this is it.  

The fact this data matches is the main point of the test and instead of just a log message I would like there to be the green checkbox symbol in the test results. This is just to help identify critical steps in tests, particularly those tied to requirements. 

 

Is there a way to do this?

  • I just had a random thought to check if there is a Log.Checkpoint function. There apparently is. I guess I answered my own question. 

  • autoguy1's avatar
    autoguy1
    Occasional Contributor

    I just had a random thought to check if there is a Log.Checkpoint function. There apparently is. I guess I answered my own question. 

    • Lee_M's avatar
      Lee_M
      Community Hero

      you are indeed correct, this is a checkpoint

       

      Log.Checkpoint("List A" == "List A")

       

      Log.Checkpoint("List A" == "List A")

       

      Consider; your required solution may need a little more coding

        var lista = "my csv list";
        var listb = "my csv list";
        
        if (lista  == listb) {
          Log.Checkpoint ("List A is the same as List B")
        } else {
          Log.Error ("List A and List B are not equal !")
        }

       

      • autoguy1's avatar
        autoguy1
        Occasional Contributor

        Thank you Lee, my solution already has if else statements with error logging, stating what exactly what elements are included that shouldn't be or should be included that are missing.  I was just trying to keep my summation brief and not really bog it down with details. 

         

        Thank you for the extra info that you can put the actual validation in the checkpoint.