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?
Exception in Log file
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
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:
Example:
Kind regards,
Gabor
Ranorex Support Team
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
)
Code: Select all
Validate.Attribute(repo.FormCalculator.OutputText, "text", "24", "Validate result", false);
Gabor
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria