Page 1 of 1

Validate without message to result report

Posted: Mon Jun 28, 2010 10:49 am
by SanMan
Hi,

I have some validation in my testcases, where e.g. searching a list and finding an item there which to click.

[Validate.AreEqual(name_a, name_b, Validate.DefaultMessage, false);]

Is there some way to have this validation done with message of failed/succeed validation?

Should the Validate.DefaultMessage be replaced with something?

Re: Validate without message to result report

Posted: Mon Jun 28, 2010 3:41 pm
by Support Team
Hi,
SanMan wrote:Is there some way to have this validation done with message of failed/succeed validation?
The Validate Class always generates a message for the Ranorex Report. But you can you use following code to log your own Report-Message to the Report.
bool result = Validate.AreEqual("test","test",Validate.DefaultMessage,false);
				
if(result == true)
{
   Report.Success("YourMessage");
}
else
{
   Report.Failure("YourMessage");
}
SanMan wrote:Should the Validate.DefaultMessage be replaced with something?
You can use the Validate.DefaultMessage or you can write your own string instead of the DefaultMessage.

Regards,
Peter
Ranorex Support Team