Precedence in validations

Ask general questions here.
User avatar
Vanderson
Posts: 13
Joined: Fri Dec 13, 2019 5:31 pm

Precedence in validations

Post by Vanderson » Mon Apr 20, 2020 5:34 pm

Hello Guys,

Here again with one more question: There precedence in validations on Ranorex? To be clear: I have on test on webpage. In this test I need to verify the existence of several itens and I would like to know the diferences between Validates.

One example::
Validate AtributeEqual Enable True <itensRepo>
Validate Exist <ItensRepo>
Validate AttributeEqual InnertText <itens> <itensRepo>

My question is: Can I Validate the iten exist if the validate is Enable False?

OR

Can I validate items with Enable True, must have Validate Exist too? Is the same?

OR

If I validate InnerText, I need to validate Enable True too? Who came first? Enable Exists Innertext or other order?

My question is because I don't find any material about this.

Thanks in advance
Best Regards,

Vanderson Araujo

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6163
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Precedence in validations

Post by odklizec » Mon Apr 20, 2020 5:45 pm

Hi,

I'm afraid, I'm not quite sure what exactly you want to achieve. Generally speaking, Validate AtributeEqual and Validate Exist are different validations.
Validate Exists simply validates existence of provided repo element. Validate AtributeEqual, on the other hand, validates equality of given attribute and defined ref. value. So in case the element does not exists, Validate AtributeEqual will, of course, fail with "element not found" exception.

At the moment, there is no way to perform conditional validation in recording modules. So in case you want to first validate the existence of an element and only then validate its attribute, you must do it in code.

Could you please describe, in more details, what exactly you want to achieve? Ideally, post also some screenshots and snapshots of problematic element(s)?
Pavel Kudrys
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

User avatar
Vanderson
Posts: 13
Joined: Fri Dec 13, 2019 5:31 pm

Re: Precedence in validations

Post by Vanderson » Mon Apr 20, 2020 6:05 pm

Hi odklizec,

Thanks for your help.
I attached some sample images to be enlightened the question:

In the image, as I said before, I have to validate some elements in web app. I would like to know the difference betwaeen validate AttributeEqual Enable True and Validate AttributeEqual Visible True. Among these, which one has more precedence or which one can I have and not the other

In my picture, steps 3, 4, 5 and 6 for example.

Thnks,

Vanderson Araujo
Attachments
ValidationsExample.png
ValidationsExample.png (15.76 KiB) Viewed 138 times
Best Regards,

Vanderson Araujo

User avatar
Stub
Posts: 371
Joined: Fri Jul 15, 2016 1:35 pm

Re: Precedence in validations

Post by Stub » Tue Apr 21, 2020 9:42 am

Are you asking what the difference between Enabled and Visible is?

I often validate both of these attributes when it's really critical that the control is both visible AND enabled before I exercise it in some way, just in case the control happens to be ENabled but is not presently visible for whatever reason (scrolled out of sight maybe).

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6163
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Precedence in validations

Post by odklizec » Tue Apr 21, 2020 1:51 pm

Hi,

Enabled attribute means, that the control is either enabled or disabled for inputs. Typically, "disabled" element is grayed out. However, many apps (including web apps) completely ignores this attribute and implement their own "enabled" state. So the general attribute Enabled is often worthless ;)

Visible attribute means, that the element is "visible" in visible area of view. If Visible attribute returns False, then the element may be either located out of the visible area of screen or set as hidden (or both).
Pavel Kudrys
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