bool this_one = Validate.Exists(repo.MyItemInfo, Validate.DefaultMessage, false);
If this item is not found, there should not be validation exception?
(ValidationException: If the validation fails and options.ExceptionOnFail is true. )
Validation exception
Re: Validation exception
Hi,
Yes, in this particular case, there should be no validation exception thrown. Are you sure the exception is not issued by another action (before/after validation)?
Anyway, if you are still getting the exception on Validate.Exists (which you should not), you can avoid it by using Try...Catch, as described here:
https://www.ranorex.com/forum/if-statem ... tml#p43758
Or by using RepoInfo.Exists() instead of Validation.Exists(), as described here:
https://www.ranorex.com/forum/if-statem ... tml#p43759
Yes, in this particular case, there should be no validation exception thrown. Are you sure the exception is not issued by another action (before/after validation)?
Anyway, if you are still getting the exception on Validate.Exists (which you should not), you can avoid it by using Try...Catch, as described here:
https://www.ranorex.com/forum/if-statem ... tml#p43758
Or by using RepoInfo.Exists() instead of Validation.Exists(), as described here:
https://www.ranorex.com/forum/if-statem ... tml#p43759
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Validation exception
Thank you!
This one worked fine:
if (repo.MyForm.MyButtonInfo.Exists()) { //notice MyButtonInfo instead of MyButton
//do stuff
}
This one worked fine:
if (repo.MyForm.MyButtonInfo.Exists()) { //notice MyButtonInfo instead of MyButton
//do stuff
}