Validate.Attribute questions

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

Validate.Attribute questions

Post by slavikf » Fri Mar 18, 2011 11:13 pm

I have following code:

Code: Select all

			Validate.Attribute(repo.FormWinstn.TextFailed_to_load_images__sInfo, 
			                   "Text", 
			                   "B&W and color images can't be montaged.",
			                   "TC315: Validating, that correct error message appears.",
			                  false);
I expect this method to PASS or FAIL.
However in my results i see warning:

2011/03/17 16:56:01.919 WARN Validation TC315: Validating, that correct error message appears.

Why it is Warning and not PASS/FAIL?

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

Re: Validate.Attribute questions

Post by Support Team » Sat Mar 19, 2011 12:02 am

Hello,

actions which lead to exceptions are failures else it is a warning.
Thus an action that has been marked "Continue on Fail" will have a try{}catch{} around its code.
The Validate.Attribute() function has a overload where the last boolean parameter is "exceptionOnFail" and if that is false there won't be an exception. So that's why you get a warning.

Regards,
Roland
Ranorex Support Team
.
Image

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Validate.Attribute questions

Post by slavikf » Sat Mar 19, 2011 12:09 am

Well, then it's something new in Ranorex 3.0.
Because in Ranorex 2.3.8 i saw "FAIL" in my report.

And i do not like it. Is there a way to return to previous functionality?

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

Re: Validate.Attribute questions

Post by Support Team » Mon Mar 21, 2011 11:30 am

Hi,

If you want to setup the old report format. Please use following method Setup, to initialize the "Legacy" Report method.

Regards,
Peter
Ranorex Team
.
Image

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Validate.Attribute questions

Post by sdaly » Mon Mar 21, 2011 12:20 pm

Does the TestReport class 'replace' the Report class?

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Validate.Attribute questions

Post by slavikf » Mon Mar 21, 2011 8:50 pm

Support Team wrote:If you want to setup the old report format. Please use following method Setup, to initialize the "Legacy" Report method.
I did it.
And no, it didn't help. Every time when validation fail and i have FALSE for "exceptionOnFail" i do not get FAILURE in my LOG! - same as with default Ranorex 3.0-style reports.

Now, explain to me, how i can get FAIL entry in LOG and not stop script execution?! I see only way to do it - is to use Report.Failure, which mean i have to change code and manually verify result of EVERY Validate method and add Report.Failure, so i'll have WARN and FAIL entry in LOG. What a mess!

Validate should create FAILURE method in LOG if it failed and continue if "exceptionOnFail" is FALSE, as it was doing in Ranorex 2.x...

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

Re: Validate.Attribute questions

Post by Support Team » Tue Mar 22, 2011 1:47 pm

Hi,

to setup the old reporting from 2.x you have to add a Test Case as first entry of your Test Suite which holds a Code Module with code looking as followed:
Report.Setup(ReportLevel.Always, "Test.rxlog", false, false);
After that you have to disable the new Reporting by editing the Test Suites Properties:
In General Tab you have
  • to remove the Report Files name and
  • to set the Auto Save Interval to 0
This procedure will be simplified in one of our next releases, but you can use this workaround for now.

Kind regards,
Tobias
Support Team
.
Image

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

Re: Validate.Attribute questions

Post by Support Team » Tue Mar 29, 2011 12:45 pm

slavikf wrote:Why it is Warning and not PASS/FAIL?
This is actually a bug in the 3.0.0 release and will be fixed with the upcoming service release. So from then on all Validate methods will either report "Success" or "Failure".

Additionally, reporting a "Failure" will also set the result of the test module to failed.

Regards,
Alex
Ranorex Team
.
Image

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Validate.Attribute questions

Post by slavikf » Tue Mar 29, 2011 6:00 pm

Any estimates, when next build will be available?

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

Re: Validate.Attribute questions

Post by Support Team » Wed Mar 30, 2011 10:04 am

Hi,

The service release should be available next week. We are currently in the middle of testing phase and we fix the last issues.

Regards,
Peter
Ranorex Team
.
Image