Report successfull validate values

Ask general questions here.
User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Report successfull validate values

Post by Gunner1980 » Mon Apr 12, 2010 5:21 pm

Hello,

I would like to be able to do the following but I'm not quite sure how to do it. I would like to report more than just the standard message that is displayed when a successful validation takes place.

I would like it to say the validation was complete and list the value it expected and the value it found. Almost exactly like the message that is displayed when there is a failure. The reason I would like this is because I have a combination of 4 values making up one test item so when I do have a real failure I would like to be able to duplicate the problem manually using the exact same 4 values that were entered during the automated step. Some of the values I am using are used multiple times in multiple combination's so I can't simply search for the failed item in my csv file and know which item it was associated with because it may have multiple entries.

Make sense?

Here is what my current reporting code looks like in my program.cs.

Code: Select all

 }
            catch (ImageNotFoundException e)
            {
                Report.Error(e.ToString());
                Report.LogData(ReportLevel.Error, "Image not found", e.Feature);
                Report.LogData(ReportLevel.Error, "Searched image", e.Image);
                error = -1;
            }
            catch (RanorexException e)
            {
                Report.Error(e.ToString());
                Report.Screenshot();
                error = -1;
            }
            catch (ThreadAbortException)
            {
                Report.Warn("AbortKey has been pressed");
                Thread.ResetAbort();
            }
            catch (Exception e)
            {
                Report.Error("Unexpected exception occured: " + e.ToString());
                error = -1;
            }      

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report successfull validate values

Post by Ciege » Mon Apr 12, 2010 5:50 pm

You can use Report.Success for success messages or Report.Info for informational messages etc... Report has lots of modifiers you can use.

So for example you can do something like

Code: Select all

Report.Success("Value 1: " + my.value1 + "  Value 2: " + my.value2);
is that what you were looking for?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Gunner1980
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

Re: Report successfull validate values

Post by Gunner1980 » Fri Apr 16, 2010 3:30 am

yep I got it working thanks much!