Page 1 of 1

Feature request: Validate.Attribute should return result

Posted: Fri Apr 29, 2011 9:17 pm
by slavikf
Currently Validate.Attribute return void

Please, make it return Boolean result of validation.

If you need use case, here is my scenario:
- I do not want my script to stop, when test case fails, so i use:

Code: Select all

Validate.Attribute (repo.FormSelect.RowN, "RawText", "220", "Record displayed", false);
- However, when test case fails (and only then), i want to save Screenshot to report. If method would return Boolean result i can do it.

I know, i can use TRY ... CATCH construct now, but it would be MUCH simpler and elegant, if i can do it using Boolean value.

Re: Feature request: Validate.Attribute should return result

Posted: Sat Apr 30, 2011 12:23 pm
by Support Team
slavikf wrote:Currently Validate.Attribute return void
Actually, all methods of the Validate class already return a boolean value for those overloads which have the "exceptionOnFail" argument, i.e. which you can configure to not throw an exception. For example, see the API documentation for the method you are referring to in your post:
http://www.ranorex.com/Documentation/Ra ... bute_8.htm

So the functionality you requested already exists :D

Regards,
Alex
Ranorex Team