Validate.Options ExceptionOnFail gets set to true after use

Class library usage, coding and language questions.
robertf
Posts: 1
Joined: Tue Feb 11, 2020 9:23 pm

Validate.Options ExceptionOnFail gets set to true after use

Post by robertf » Tue Feb 11, 2020 9:41 pm

I use the Validate.Attrubute function in some cases for an "if" statement or for a "while" loop and I don't want it to throw an exception if it fails. In the example attached, I am trying to check a bunch of check boxes, but I do not want to touch them if they are already checked.

In previous versions of Ranorex, when I created a Validate.Options variable and set ExceptionOnFail to false, it kept that setting no matter how many times I used that variable. But, after I updated to 9.2, the ExceptionOnFail for the variable gets set to true after it is used once. Is this a bug or is this the desired behavior moving forward? I got around this by setting the ExceptionOnFail back to false after each use. (see attached)
CheckAllCostTypes.png
CheckAllCostTypes.png (35.64 KiB) Viewed 41 times

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

Re: Validate.Options ExceptionOnFail gets set to true after use

Post by Support Team » Thu Feb 13, 2020 5:44 am

Hello Robert,

I can verify I am seeing the same behavior, I will have to investigate as to why the behavior has changed with the update but as I am sure you are aware with updates comes improvements and changes to our API. Once I do some digging I will be sure to respond to the thread with more information. In the meantime, I am happy you have found a workaround.

Regards,
Sean
.
Image