How to validate a pop out window

Class library usage, coding and language questions.
martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

How to validate a pop out window

Post by martinsw » Fri Dec 09, 2011 3:24 pm

Dear Ranorex support team,

I am using an application which, when i click on a button called "settings", results in a settings window appearing from the right hand side of the screen. By default, the settings window is hidden off on the right hand side of the screen prior to the settings button being clicked. I am trying to create a test module that validates that this settings window does indeed appear from the right hand side of the screen when a user clicks on the settings button.

I have tracked the settings window using spy and then created a step in my recording to validate that it exists after the user clicks on the settings button. However, this is not a valid test as the window always exists....its just that its hidden from view and only becomes visible when the user clicks on the settings button. So such a test will always pass, even in cases where the window does not appear which is not what I want.

I've also tried a 'compare image' based validation. What i did was take a screenshot of something on the settings window in the hope that the validation would fail when the window was hidden i.e. in a different location to where it is when it's visible. But the image based validation passes, even when the settings window is not visible on the screen. Can you confirm why a 'compare image' based validation would pass in these circumstances?

More importantly, can you confirm if there are any other methods i should try that would result in a successful test? A successful test would be the validation passing if the settings window appears but failing if the settings window does not appear. The Xpath for the window is the same whether it is visible or hidden off to the right hand side. The only difference I can see is that the screen location values are different in the 'layout' section in spy. These values are greyed out so I'm not sure if it's possible to include these values in the path. Can you confirm please?

Let me know if you need any more information.

Many thanks,

Martin

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

Re: How to validate a pop out window

Post by Support Team » Fri Dec 09, 2011 4:16 pm

Could you please post a Ranorex snapshot of the settings form? (See this section in the Ranorex User Guide how to create Ranorex snapshots)
martinsw wrote:By default, the settings window is hidden off on the right hand side of the screen prior to the settings button being clicked.
Does "hidden off" mean that the "Visible" property of the form is "false" when tracked with Ranorex Spy? If so, you can validate the "Visible" property to have the correct value.
martinsw wrote:Can you confirm why a 'compare image' based validation would pass in these circumstances?
Depending on the technology the form is created with, Ranorex can be able to create a screenshot of an element even if the element is hidden. Consequently, if the screenshot can be taken and is correct, the CompareImage validation will be successful. To check whether an element is visible, one should usually validate its "Visible" attribute (or the "Visible" attribute of its parent/ancestors).

Regards,
Alex
Ranorex Team
.
Image

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: How to validate a pop out window

Post by artur_gadomski » Mon Dec 12, 2011 9:56 am

You might want to use an element you know is on Settings window like 'Ok' or 'Close' button rather than whole window.
Or you can try to validate screen location as part of the test.

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

Re: How to validate a pop out window

Post by Support Team » Mon Dec 12, 2011 10:51 am

Hi,

please provide a snapshot of your application BEFORE you press the settings button (the settings window is hidden) and AFTER the button settings was pressed (the settings window is visible).

You can validate on every single attribute of the settings window with AttributeEqual (e.g. visible, acitive...).
One of the attributes will give you the information if the behavior of the settings windows has changed.

To assist you, please provide the requested two snapshots.

Best Regards,
Martin
Ranorex Support Team
.
Image

martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

Re: How to validate a pop out window

Post by martinsw » Mon Dec 12, 2011 11:33 am

Dear Ronorex support team,

Thank you for your response it has pointed me in the right direction. The 'Visible' attribute for the settings popout form (Div 'SettingsArea') always has a value of "true" whether it is on the screen or hidden off to the right hand side. However, for the elements within the form, e.g. H1 "Settings", their visible values change from "false" to "true" when the form is at first hidden off the screen and then on the screen (once the use clicks on the "settings" button). This change in values has allowed me to set up the test I want.

I'd still be interested to know on whether or not it is possible to include greyed out attributes in the Ranorex path and to interact with these values. For example, the "screen layout" section in the "detail" tab in spy. Can you confirm please?

Thanks, Martin

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

Re: How to validate a pop out window

Post by Support Team » Mon Dec 12, 2011 1:13 pm

Hi,

Yes, it is possible, if the path is correct, the element will be found on the screen.
Enabled elements are on the screen, the only thing is that the Enabled attribute is set false.

You can check this on your own, e.g. open internet explorer, open the context menu of a site (right mouse click on the site) and do a instant tracking on a enabled="false" (grayed item) menu item (e.g. forward).

Best Regards,
Martin
Ranorex Support Team
.
Image