Page 1 of 1

How do you programatically get test results into a variable

Posted: Wed Jun 19, 2013 9:30 pm
by smullin
I am trying to create my own report and need to get the status (success / fail) of a validaton. How do I get that into a variable.

Re: How do you programatically get test results into a variable

Posted: Thu Jun 20, 2013 4:37 pm
by Support Team
Hello,

In general the return value of the Validate.Exists() method is a bool.
If the validation failed, the return value is False otherwise it is True.
You can just write it in a variable using the following code:
string myVar = Validate.Exists(path, searchTimeout, message, exceptionOnFail).ToString();
You can just write it in your report using Report.Info(myVar).
Please let me know if you need more information or assistance.

Regards,
Bernhard