Exception in Log file

Bug reports.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Exception in Log file

Post by atom » Thu Jan 22, 2009 7:33 pm

Ive recorded a test case that validates the text in a text box
All works ok when I play it from Studio
But if i compile it to an .exe, and then execute it - there is an exception:

<![CDATA[Ranorex.ValidationException: Attribute 'windowtext' of element '{Text:_maskBox}' does not match the specified value (actual='700.00', expected='1000.00').]]><br/>
<![CDATA[ at Ranorex.Validate.IsTrue(Boolean condition, String message, Boolean exceptionOnFail)]]><br/>
<![CDATA[ at Ranorex.Validate.Attribute(Element element, String name, Object value, String message, Boolean exceptionOnFail)]]><br/>
<![CDATA[ at Ranorex.Validate.Attribute(Element element, String name, Object value)]]><br/>
<![CDATA[ at ISOPHIS.ISOPHIS.Recording1.Start() in C:\Documents and Settings\cneal\My Documents\RanorexStudio Projects\ISOPHIS\ISOPHIS\Recording1.vb:line 65]]><br/>
<![CDATA[ at ISOPHIS.ISOPHIS.Program.Main() in C:\Documents and Settings\cneal\My Documents\RanorexStudio Projects\ISOPHIS\ISOPHIS\Program.vb:line 31]]><br/>

Thanks

----------------------
update

It seems when you do a validation in a recording, as the Validation class is called with no error handling, if the validation fails, you will always get an exception logged, and script will stop...

Is there a way to force execution to continue? directly when recording?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Fri Jan 23, 2009 4:15 pm

You have to set the exceptionOnFail parameter to false if you would like to continue your test script on failed validation.

Set the exceptionOnFail parameter for the following overload method:

Code: Select all

public static bool Attribute(
	Element element,
	string name,
	Regex regex,
	string message,
	bool exceptionOnFail
)
Example:

Code: Select all

Validate.Attribute(repo.FormCalculator.OutputText, "text", "24", "Validate result", false);
Kind regards,
Gabor
Ranorex Support Team

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Post by atom » Mon Jan 26, 2009 10:50 am

Ok sounds good...
Is there a way to do that in the Recorder GUI
Instead of modify all generated code from the Recorder?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Tue Jan 27, 2009 6:01 pm

Currently, no. The replay always stops if a validation fails. I added this issue to our wanted-features list.

Regards,
Alex
Ranorex Support Team