Validate without message to result report : Automation API

Validate without message to result report

Class library usage, coding and language questions.

Validate without message to result report

Postby SanMan » Mon Jun 28, 2010 11: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?
SanMan
 
Posts: 49
Joined: Tue Apr 13, 2010 10:59 am

Re: Validate without message to result report

Postby Support Team » Mon Jun 28, 2010 4: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron