Feature request: Validate.Attribute should return result

Class library usage, coding and language questions.
User avatar
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada

Feature request: Validate.Attribute should return result

Post by slavikf » Fri Apr 29, 2011 9:17 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12139
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Feature request: Validate.Attribute should return result

Post by Support Team » Sat Apr 30, 2011 12:23 pm

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

Ranorex Team