Forum Discussion

m_essaid's avatar
m_essaid
Valued Contributor
9 years ago

Comparing DBTables

Hi guys,

 

In my tests every step must not be an error. I use "stop on error" to leap to the other test item.

In other words, when I have a red icon it's because something went wrong.

 

For this reason, I don't use checkpoints, but the Compare method.

 

I'm building a test that compares fields in different tables. Until now everything is correct : I put the right parameter in the compare method to have, if it doesn't match, a warning instead of an error.

 

If I would be using a checkpoint I would have an error and the test item would "crash".

 

My problem is that I want to report (with Log.Message or something else) the content of the stored dbtable field and the content of the compared DBTable.

 

 

Is there any way to get theses two contents ?

 

Thank you,

 

Mehdi

    • m_essaid's avatar
      m_essaid
      Valued Contributor

      Hi Robert,

       

      Indeed the message is something like "the field x is different".

      But I would like to be able to read the values... not only get a hash value.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        As per the documentation, out of the box, you have either Check which gives the specific details or Compare which gives you less information.

         

        If you want to do something more detailed... What I would do is do the Compare and get the boolean value from it to determine if the Compare passed or failed.  Then, if it failed, I would write custom code to parse the table and look for the details.  That is really, at this point, you're only out if you're set on using the "Stop on Error" flag.

        Personally, I don't use "Stop on Error". If I want the test to stop, I want control over that.  So, even if I get an error, if it's not a critical halt (coding error, object not found, etc), then I can log it and proceed from there.  It takes more work up front, for sure, but it means that I have better control over my tests.