Validate without message to result report

Class library usage, coding and language questions.
SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Validate without message to result report

Post by SanMan » Mon Jun 28, 2010 10:49 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Validate without message to result report

Post by Support Team » Mon Jun 28, 2010 3:41 pm

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