Ranorex is not recognizing the XPath of dynamicaly rendered

Ask general questions here.
iam7
Posts: 3
Joined: Thu Oct 30, 2014 9:38 pm

Ranorex is not recognizing the XPath of dynamicaly rendered

Post by iam7 » Thu Oct 30, 2014 11:03 pm

Ranorex is not recognizing the XPath of dynamicaly rendered buttons inside the File Ribbon Group.
Ranorex seem to calculate the coordinates from another (wrong) object to the button which is clicked.
So when the recording is made -the test runs sucessfully, however the screen-prints point to the wrong object.
The problem I have is -if the resolution is changed all the tests are going to fail.

I am sure this is a common problem and it was addressed earlier. I am new to Ranorex.
Perhaps I can utilize some of the image recognision capabilities.

Sincerely,

Ivan Melnikov

CookieMonster
Certified Professional
Certified Professional
Posts: 74
Joined: Mon Aug 14, 2006 7:17 pm
Location: CH

Re: Ranorex is not recognizing the XPath of dynamicaly rendered

Post by CookieMonster » Fri Oct 31, 2014 9:38 am

Hi Ivan,

May your problem is the XPath itself. I also struggling sometimes with XPath problems in our java application. Because our developers change a container or remove it, where the object to automate is displayed and even if they have removed the container the object is still visible, then you have fix your XPath or create an XPath, which does ignore such changes.
Due to the fact, that you are working dynamically objects and with repository which was created during recording, may it make sense first to have a look on the XPath itself.

May it makes sense, if you post a Spy snapshot of the working automation and a snapshot which is not working.

Cheers
Dan

iam7
Posts: 3
Joined: Thu Oct 30, 2014 9:38 pm

Re: Ranorex is not recognizing the XPath of dynamicaly rendered

Post by iam7 » Fri Oct 31, 2014 3:23 pm

Ranorex is not recognizing the object correctly ScreenPrint1.jpg
Ranorex is not recognizing the object correctly ScreenPrint1.jpg (169.24 KiB) Viewed 976 times
Dan,

Thanks a lot for responding so promptly! I have attached 3 screen-prints where I am using the Ranorex Spy to point my mouse to the objects located within the File Ribbon Group.
As you can see 2 of them -'New' button and an 'Open' are active (on the top left hand side of the picture). When I point my mouse to the either of the buttons Ranorex Spy identifies them as a 'Help' button, which it actually highlights (in red).
After the recording is run the recorder does emulate the action of clicking on the 'New' or 'Open' buttons correctly & the test runs sucessfully and performs the clicks correctly. However, it recognizes those buttons within the ribbon as a 'Help' button, for some reason. Please see the 3rd screen-print where the step of clicking on the 'New' button is showing.
Ranorex calculates the pixels from the 'Help' button to point to the 'New' button on which I click during the recording. It is showing the location as negative 261;56.

Again, the issue here, as I understand it, is that objects within the ribbon are rendered dynamically, so Ranorex does not recognize anything inside of it.
I have tried to replace the XPath, & I am pretty certain that it is correct, however the tests fail.

Thanks for your help!

Ivan
Attachments
How the Ranorex records the actions of clicking on the buttons within the Ribbon.jpg
How the Ranorex records the actions of clicking on the buttons within the Ribbon.jpg (313.28 KiB) Viewed 976 times
Ranorex is not recognizing the object correctly ScreenPrint2.jpg
Ranorex is not recognizing the object correctly ScreenPrint2.jpg (169.31 KiB) Viewed 976 times

CookieMonster
Certified Professional
Certified Professional
Posts: 74
Joined: Mon Aug 14, 2006 7:17 pm
Location: CH

Re: Ranorex is not recognizing the XPath of dynamicaly rendered

Post by CookieMonster » Fri Oct 31, 2014 5:35 pm

Hi Ivan,

Could you make a small test with your script. Please change all locations to Center (Click on the drop down list and choose it), do not use coordinates. May be for some reason you have a wrong values in it.

Cheers
Dan

iam7
Posts: 3
Joined: Thu Oct 30, 2014 9:38 pm

Re: Ranorex is not recognizing the XPath of dynamicaly rendered

Post by iam7 » Fri Oct 31, 2014 6:11 pm

Dan,

OK. I have actually changed the Record Defaults/ Coordinate recording mode to None. And now my tests have stopped working, because, indeed the system is now trying to click the 'Help' button when I play the test back.
Even though during the recording I have actually clicked the 'New' button'.

Ivan
Last edited by iam7 on Mon Nov 03, 2014 11:45 pm, edited 1 time in total.

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

Re: Ranorex is not recognizing the XPath of dynamicaly rendered

Post by krstcs » Fri Oct 31, 2014 6:21 pm

My guess is that this doesn't have anything to do with coordinates vs. relative clicks. I don't think the action of clicking is the problem.

This appears to be an object identification issue. Ranorex is identifying the tab page but not the elements inside it.

This is either a problem with the application under test not being coded correctly for use with automation, or it is an XPath issue, where the path is pointing to the wrong element. (My guess would be the first one, but that is a guess...)

Please post a Ranorex Snapshot (not a screenshot) of the application under test and the RanoreXPath of the elements in question. For information on creating a snapshot, please see this page.

If you cannot post these things on the forum, then you should send them to [email protected]. The Ranorex support team can help you figure out the problem pretty quickly.
Shortcuts usually aren't...