How to interact with maximize item (in windows 7 & 8.1)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
minh.nguyen
Posts: 5
Joined: Mon Oct 06, 2014 4:11 am

How to interact with maximize item (in windows 7 & 8.1)

Post by minh.nguyen » Mon Oct 06, 2014 4:24 am

Hi guys,

I've developed some test scripts and one of them need to be run on both windows 7 and windows 8.
Steps is:
1. Open a folder
2. Maximize folder
3. Copy an item to that folder
4. Delete that item
I've developed this test scripts on windows 8 so it work correctly. But when I bring my test script on windows 7, It shows the error message at step 2 (maximize folder) and I've determined that when i use "Ranorex Spy" to spy object, the form of "Maximize" button: "/form[@title='Form-name']/?/?/button[@automationid='Maximize-Restore']"
And in windows 7, this form don't contain Form-name so ranorex can't interact with it.

And one thing.
When Right Click on this folder and select for example: Send To (menu item), system will show a child-menu and this is another problem.
1. When child-menu shows in the right of main-menu, it has another locator.
2. When child-menu shows in the left of main-menu, it has another locator.

So how can i do it on both windows? Is there anyway to workaround, bypass?

Thank in advance.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to interact with maximize item (in windows 7 & 8.1)

Post by krstcs » Mon Oct 06, 2014 2:30 pm

Instead of clicking on the max/min/restore buttons (which you aren't really testing unless you work for Microsoft, these functions are external to your test), you should use the Invoke Action -> Maximize/Minimize/Restore. These will always work and you don't have to click anywhere.
Shortcuts usually aren't...

minh.nguyen
Posts: 5
Joined: Mon Oct 06, 2014 4:11 am

Re: How to interact with maximize item (in windows 7 & 8.1)

Post by minh.nguyen » Mon Oct 06, 2014 2:32 pm

Hi @krstcs,

How about my second question?
----- FYI
When Right Click on this folder and select for example: Send To (menu item), system will show a child-menu and this is another problem.
1. When child-menu shows in the right of main-menu, it has another locator.
2. When child-menu shows in the left of main-menu, it has another locator.

So how can i do it on both windows? Is there anyway to workaround, bypass?

Thanks

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to interact with maximize item (in windows 7 & 8.1)

Post by krstcs » Mon Oct 06, 2014 2:41 pm

Assuming the context of the menus is the same, I would think that the RXPath for both would be the same, and Ranorex should have no problem with them.

What exactly isn't working? Have you spied out both to see what the differences are?



Also, what version of Ranorex are you using?
Shortcuts usually aren't...

minh.nguyen
Posts: 5
Joined: Mon Oct 06, 2014 4:11 am

Re: How to interact with maximize item (in windows 7 & 8.1)

Post by minh.nguyen » Mon Oct 06, 2014 2:54 pm

Sure,

This is the locator when it appears in the left "/contextmenu[@class='#32768' and @instance='0']/?/?/menuitem[@accessiblename='Folder']"
And when it appears in the right "/contextmenu[@class='#32768' and @instance='1']/?/?/menuitem[@accessiblename='Folder']"

The difference is @instance='1' without this thing, I can't interact with child-menu.

Any ideal?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to interact with maximize item (in windows 7 & 8.1)

Post by krstcs » Mon Oct 06, 2014 3:01 pm

Have you tried just removing the instance attribute from the path? Like this:

/contextmenu[@class='#32768']/?/?/menuitem[@accessiblename='Folder']
Shortcuts usually aren't...