item discovery conditional of window maximize state?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
geremyr
Posts: 5
Joined: Thu Feb 17, 2011 5:34 am

item discovery conditional of window maximize state?

Post by geremyr » Thu Feb 17, 2011 6:06 am

I'm having an issue with item recognition based on whether the application under test is maximized or not. Put simply, if the application window is maximized when the recording is created, the item recorded will only be found if the window is maximized prior to runtime (and vice-versa).
Item 'FormSTREAMS_Explorer.ContainerContentPanel1.TreeItemField_Processors' was not found within the specified timeout of 10s.
Strangely, the item is accurately 'highlighted' from the repository regardless of the window's maximized state.

Snapshot attached.

Windows Vista Business SP1
Ranorex (evaluation) version 2.3.8.10854
Attachments
streams.7z
Ranorex snapshot
(144.18 KiB) Downloaded 237 times

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

Re: item discovery conditional of window maximize state?

Post by Support Team » Thu Feb 17, 2011 12:53 pm

Hi,

do you work with relative or absolute coordinates?
What exactly do you want to automate?
Can you provide us your recording?

Thanks.

Kind regards,
Tobias
Support Team
.
Image

geremyr
Posts: 5
Joined: Thu Feb 17, 2011 5:34 am

Re: item discovery conditional of window maximize state?

Post by geremyr » Thu Feb 17, 2011 11:24 pm

I've reduced the recording to only one step as a means of identifying this problem. The coordinates are relative - set to 'center'. Right now, I'm attempting a simple verification that when an item in the left pane is selected, the main content pane is updated accordingly (i.e. a left mouse click on the item 'TreeItemField_Processors'). This is so strange, as I'm not experiencing this problem with other elements of our application. I should reiterate that the repository accurately highlights this item regardless of window size; there seems to be a discrepancy at runtime.

Thanks for your time.
Geremy

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

Re: item discovery conditional of window maximize state?

Post by Support Team » Fri Feb 18, 2011 2:16 pm

geremyr wrote:I should reiterate that the repository accurately highlights this item regardless of window size
Please, keep us posted about your findings.

Regards,
Alex
Ranorex Team
.
Image

geremyr
Posts: 5
Joined: Thu Feb 17, 2011 5:34 am

Re: item discovery conditional of window maximize state?

Post by geremyr » Mon Feb 21, 2011 12:58 am

The problem still occurs during execution/playback. Any suggestions?

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

Re: item discovery conditional of window maximize state?

Post by Support Team » Mon Feb 21, 2011 8:25 pm

Could you please post the RanoreXPath for the problematic repository items? Even better, please, post the repository and the recording that fail. Then we can have a look at it and hopefully support you better :)
Thank you!

Regards,
Alex
Ranorex Team
.
Image

geremyr
Posts: 5
Joined: Thu Feb 17, 2011 5:34 am

Re: item discovery conditional of window maximize state?

Post by geremyr » Tue Feb 22, 2011 5:01 am

So I found a way to make the recording work. The problem seems related to the repository - in the case where it doesn't work, I created a large repository by choosing the top level item (streams explorer) and adding it with children. In the case where it does work, I created a very small repository by choosing only the element that I'm interested in (TreeItemField_Processors1), and adding it.

The resulting repository in both cases is a rather different path to the end element (which is the same), and seems to be the difference between this step finding the element or not based on the size of the window.

The recording that doesn't work:

Code: Select all

			Mouse.DefaultMoveTime = 300;
			Keyboard.DefaultKeyPressTime = 100;
			Delay.SpeedFactor = 1.0;

			Report.Info("Mouse Left Click item 'FormSTREAMS_Explorer.ContainerContentPanel1.TreeItemField_Processors' at Center.");
			repo.FormSTREAMS_Explorer.ContainerContentPanel1.TreeItemField_Processors.Click();
			Delay.Milliseconds(2880);
The repository paths

FormSTREAMS_Explorer:

Code: Select all

/form[@controlname='MainForm' and @title='STREAMS Explorer']
ContainerContentPanel1:

Code: Select all

container/container[@controlname='contentPanel']
TreeItemField_Processors:

Code: Select all

container/container/container[@caption='' and @controltypename='SplitterPanel' and @instance='0']/container/container[@caption='' and @controltypename='SplitterPanel' and @instance='0']/container[@controlname='PanelContainer']/container/container/container[@controlname='pnlContent']/container/tree/treeitem[@accessiblename='Field Processors']
The recording that works:

Code: Select all

			Mouse.DefaultMoveTime = 300;
			Keyboard.DefaultKeyPressTime = 100;
			Delay.SpeedFactor = 1.0;

			Report.Info("Mouse Left Click item 'FormSTREAMS_Explorer.TreeItemField_Processors1' at Center.");
			repo.FormSTREAMS_Explorer.TreeItemField_Processors1.Click();
			Delay.Milliseconds(700);
The repository paths

FormSTREAMS_Explorer:

Code: Select all

/form[@title='STREAMS Explorer']
TreeItemField_Processors1:

Code: Select all

container/container[@controlname='contentPanel']/container/container/container[@caption='' and @controltypename='SplitterPanel' and @instance='0']/container/container[@caption='' and @controltypename='SplitterPanel' and @instance='0']/container[@controlname='PanelContainer']/container/container/container[@controlname='pnlContent']/container/tree/tree/treeitem[@accessiblename='Field Processors']

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

Re: item discovery conditional of window maximize state?

Post by Support Team » Tue Feb 22, 2011 8:16 pm

Hello Geremy,

I can see two things that could be the reason:
- @controlname='MainForm'
- folder caching

Could you help us a little further to unriddle the problem by doing the changes stepwise:

1. removing @controlname='MainForm' in the first version.
2. remove the folder
2a. you could also try to turn off folder caching in settings / repository defaults

regards,
Roland
Ranorex Support Team
.
Image

geremyr
Posts: 5
Joined: Thu Feb 17, 2011 5:34 am

Re: item discovery conditional of window maximize state?

Post by geremyr » Wed Feb 23, 2011 12:24 am

Thanks for the suggestions... I can make this work by reworking the repository, but that's undesirable.

In both cases above the path to the element is ultimately the same, albeit with less sub paths in the working scenario. If you do see a problem with the repository structure, should it be corrected in the way repositories are generated (or interpreted)? The only difference between the two repositories from my point of view is the amount of items I added to each one (created both in Ranorex Spy).

I'll try to find a way to make this work; perhaps I'll add some code to maximise the window before testing. Thanks for your support.

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

Re: item discovery conditional of window maximize state?

Post by Support Team » Wed Feb 23, 2011 9:44 pm

Please also have a look at this forum entry

Regards,
Roland
Ranorex Support Team
.
Image