Page 1 of 1

Report successfull validate values

Posted: Mon Apr 12, 2010 5:21 pm
by Gunner1980
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;
            }      

Re: Report successfull validate values

Posted: Mon Apr 12, 2010 5:50 pm
by Ciege
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?

Re: Report successfull validate values

Posted: Fri Apr 16, 2010 3:30 am
by Gunner1980
yep I got it working thanks much!