Different rxpaths for same control in different machine
Posted: Wed Sep 07, 2011 2:40 pm
Hi,
I am having a button in my system tray. When i click that button, it will show me a context menu. I have to click the menu item named 'X'. When i Click the 'X', it will display a submenu, from there i have to select menu item 'Y'. This is the scenario, i want to automate.
For Item 'X' the rx path is /contextmenu[@processname='Launcher' and @class='#32768' and @instance='0']/contextmenu/menuitem[20]
For Item 'Y' (the sub menu, which appears only after clicking menu item 'X') the rx path is /contextmenu[@processname='Launcher' and @class='#32768' and @instance='1']/contextmenu/menuitem[2]
Now both these paths works fine in my machine. But when i move the same code into different machine, both for Item 'X' and item 'Y' the instance should be zero in the rxpath, then only it works. Why this difference.
Also please note that, I have analyzed both the context menu items, and they have similar properties (only handle is varying, that cannot be used to differentiate them in the code, because it is dynamically generated.)
I cannot provide you the snap shot, because the application is under secure location.
My question here is, even if i go by the second machine's rxpath, (where @instance='0' for both the items 'X' and 'Y') how it is correctly selecting the sub menu item 'Y', because the same rx path for 'Y' can lead to the second menu item in the contextmenu where item 'X' is found. (i.e the same path is applicable for 2 nd item in the context menu where item 'X' resides)
Kindly help,
Regards,
Siva R S
I am having a button in my system tray. When i click that button, it will show me a context menu. I have to click the menu item named 'X'. When i Click the 'X', it will display a submenu, from there i have to select menu item 'Y'. This is the scenario, i want to automate.
For Item 'X' the rx path is /contextmenu[@processname='Launcher' and @class='#32768' and @instance='0']/contextmenu/menuitem[20]
For Item 'Y' (the sub menu, which appears only after clicking menu item 'X') the rx path is /contextmenu[@processname='Launcher' and @class='#32768' and @instance='1']/contextmenu/menuitem[2]
Now both these paths works fine in my machine. But when i move the same code into different machine, both for Item 'X' and item 'Y' the instance should be zero in the rxpath, then only it works. Why this difference.
Also please note that, I have analyzed both the context menu items, and they have similar properties (only handle is varying, that cannot be used to differentiate them in the code, because it is dynamically generated.)
I cannot provide you the snap shot, because the application is under secure location.
My question here is, even if i go by the second machine's rxpath, (where @instance='0' for both the items 'X' and 'Y') how it is correctly selecting the sub menu item 'Y', because the same rx path for 'Y' can lead to the second menu item in the contextmenu where item 'X' is found. (i.e the same path is applicable for 2 nd item in the context menu where item 'X' resides)
Kindly help,
Regards,
Siva R S