BUG: Chrome extension reporting different object locations

Bug reports.
krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 05, 2013 3:24 pm

Ranorex 4.1.3
Windows 7 (both x86 and x64, have done it on multiple systems)
Chrome 31

This appears to be a regression issue with the Chrome extension in 4.1.3. 4.1.2 works as expected.

When running a module by itself on a Chrome web document, objects are correctly identified and found. Spy finds the elements in the proper location as well.

However, when running the same module in a suite, after reloading the web page, the object's location is reported incorrectly and Ranorex attempts to click the object, but moves the mouse to the wrong location.

It appears that the Chrome plugin is reporting coordinates from the display origin instead of from the Chrome web document origin.

I have attached a screen shot showing (first) the live element, spied after the test failed, and (second) a snapshot of the same element just before the test failed. Notice the locations are very different.

I have tried to reproduce the issue in another test solution, but it seams to work fine there, which makes me think this has something to do with the problematic solution having been created in an earlier version of Ranorex (4.0.3 or so, I think).

BTW, the same test solution works without problem in IE and FF, so this is a Chrome only issue.

I have tried it on 4.1.2 and it works fine with all browsers, same solution.

Also, I have seen the Chrome extension not be recognized by Ranorex at runtime about half the time since upgrading. This may have to do with other extensions I have running on my local system (AdBlock Plus, for example), but it appears that Ranorex is not waiting for the addon to load before it continue with the test after I use an OpenBrowser action. And, it doesn't seem to be consistent. Sometimes there is a warning, sometimes there isn't. I am going to try adding a delay, but this is a workaround at best. This also was not a problem until upgrading to 4.1.3.

I'm sending the report and snapshot directly to [email protected].
You do not have the required permissions to view the files attached to this post.
Shortcuts usually aren't...

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 05, 2013 3:49 pm

Ok, after further investigation, it appears that the DOM is being reported with an origin of (0,0), as opposed to the correct (2050,129).

Again, only happens on Chrome, and only when running a test suite, and after a page load of some kind (after the initial load on startup).

What is interesting is that the first few actions work correctly, up to the point where a new page is loaded.

So, any actions I take on the page after the initial startup of Chrome, but before another page load, work fine. But, any actions AFTER the next page load don't.

Somewhere in the Chrome extension it is resetting the origin of the DOM to (0,0) when a new page is loaded.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: Chrome extension reporting different object locations

Post by Support Team » Thu Dec 05, 2013 4:58 pm

Thanks for the report,

With 4.1.3 we changed the way the DOM location is calculated, so you might be on to something.
This was necessary because of internal changes to Chrome >=32
The issue did not pop up in our regression tests but we will try to reproduce it.

Michael
Ranorex Team

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 05, 2013 5:14 pm

Thanks Michael. I figured it was something like that.
Shortcuts usually aren't...

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 12, 2013 6:11 pm

It appears that this bug has been fixed in 4.1.4. Appreciate the quick turn-around.

However, this fix appears to have introduced a new bug when attempting to find input tags in Chrome after the tag is reloaded with the dom.

I am now getting "could not be found using its absolute path" warnings (in Chrome ONLY) for all input tags after any page reload. The initial load of the page works fine, with no warnings, but not after a reload.

The test runs correctly, except that I get these warnings for every input tag (and also have a long wait time for the tests due to the search timeout) after the site is reloaded.

I don't know what Google did to Chrome in 32+ to warrant this change, but this has basically killed Chrome testing for us using Ranorex.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: Chrome extension reporting different object locations

Post by Support Team » Fri Dec 13, 2013 11:09 am

Thats quite bad :(

Could you describe the issue in a little bit more detail?
I have tried to reproduce this but couldnt (with either Chrome 31/32)

What I did in my test is navigating between pages, searching for input tags (and others) and setting input values. In one case, I keep the WebDocument object, in another case I use the repository for finding stuff.

Maybe you could post a code snippet?

Michael
Ranorex Team

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Fri Dec 13, 2013 5:56 pm

Michael,

This happens only in Chrome, but it is happening in 4.1.2 as well (although the project being used in 4.1.2 has been updated to 4.1.4).

It appears that the cached elements in Chrome are not being updated when the page reloads.

I am using Validation steps before the offending steps, and even the validation step throws the warning.

The warning is:
==========================================================================================
Item 'TCS_WEBRepository.TCS_WEB_COMPLETE.Body.ProductPage.ProductSKUsTable.ProductRowByItemSKU.Self' could be found using its absolute path, but not using its relative path from the cached element of parent folder 'TCS_WEBRepository.TCS_WEB_COMPLETE.Body.ProductPage.ProductSKUsTable'. This can happen if either the item search timeout is too small or if items within a rooted folder do not share a common parent element. To fix this problem, first increase the item search timeout. If this does not help, create a separate rooted folder for this item or disable caching for the specified folder.
==========================================================================================

The search timeout is 30s. The path is fine in other browsers, and the warning is not thrown there. The path also works fine with Spy/Highlight.

The interesting part here is that when I move the items out of the rooted folders in the repository, they are found correctly, so this appears to be a regression with regards to caching in Chrome. After an item is found the first time, the cache is not updated for future changes.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: Chrome extension reporting different object locations

Post by Support Team » Thu Dec 19, 2013 3:46 pm

Hello,

Would it be possible to create a small solution for us?
This would help us to reproduce and analyze your issue.

Thanks in advance.

Regards,
Markus (T)

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 19, 2013 4:07 pm

Markus,

I have tried to recreate it with a different (completely new) solution, but in the new solution it works as expected.

This appears to be an issue with some of the repository folders not caching correctly in Chrome's add-in if they were created in 4.1.2 or earlier. I have looked at the objects (and their properties) side-by-side and they appear to be the same. If I go in and re-create the repository objects, they appear to work afterwards, in some situations, but not all. But I can't go in and re-create the repo objects (and shouldn't need to), especially when it works in FF and IE.

The objects that have issues are folders and particularly folders with variables in the XPath.

As I said, the same solution works correctly for FF and IE, but 4.1.4 causes issues with Chrome. Since 4.1.2 worked correctly with Chrome, it most likely isn't the solution but the Chrome plugin.

I'll keep working on a recreation as I have time, but I have actual tests to write, so this will take a back-seat to that.
Shortcuts usually aren't...

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Thu Dec 19, 2013 5:23 pm

OK, I just sent a very small solution to the support inbox. It has a subset of the modules and repo objects that will produce the same issue.

Runs fine in IE and FF, but Chrome throws warnings after the first time through.

Let me know if you need anything else.
Shortcuts usually aren't...

User avatar
BernhardS
Ranorex Guru
Ranorex Guru
Posts: 32
Joined: Tue Dec 17, 2013 6:35 pm

Re: BUG: Chrome extension reporting different object locations

Post by BernhardS » Fri Dec 20, 2013 1:51 pm

Hello krstcs,

Thank you for the solution. We have forwarded it to the development team and will get back to you as soon as we have more information.

Regards,
Bernhard

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Wed Feb 05, 2014 10:21 pm

OK, so the base issue seems to have been fixed, but now every repository folder item must be set to NOT use caching. If I don't do that I get warnings after each page load for every repo folder item I try to interact with.

Again, only happens on Chrome, the exact same repository and test runs without issue on FF and IE.

This is with Ranorex 4.1.5 and Chrome 31 on Windows 7 x64.

I am sending a report with the issue in it to support. The test ran through some very simple validations on IE, FF, then Chrome. IE and FF both worked flawlessly, but once the page reloads in Chrome, most of the repo folder items throw warnings that they could only be found with their absolute path, until I go in and set EVERY parent folder to NOT use caching.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: Chrome extension reporting different object locations

Post by Support Team » Thu Feb 06, 2014 5:54 pm

Hi krstcs,

Thank you for the report file.
It seems hat the RanoreXPath for the folder of the specific item is not unique.
Alex, one of my colleagues explained the behavior in the following two posts.

http://www.ranorex.com/forum/how-do-i-f ... t1357.html
http://www.ranorex.com/forum/warning-fo ... t1576.html

Please let me know if this doesn't answer your question.

Regards,
Bernhard

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

Re: BUG: Chrome extension reporting different object locations

Post by krstcs » Fri Feb 07, 2014 2:45 pm

Except that the path IS unique.

And, as I already stated, the same test on the same site with the same paths and same workflow works just fine on IE 8/9/10/11 and FF.

This is an issue with the Ranorex Chrome plugin, not with my test.

With caching ON, it works fine in IE 8/9/10/11 and FF.

With caching OFF, it works fine in IE 8/9/10/11, FF, and Chrome.

The ONLY difference is Chrome, and that means it is an issue with the Ranorex plugin for Chrome, and my guess would be that it is related to the earlier issue, which was fixed, so this is probably a regression or an unintended side-effect.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: Chrome extension reporting different object locations

Post by Support Team » Wed May 14, 2014 2:02 pm

Hello all,

This is just a little update regarding the issue reported by krstcs.
This issue was fixed in Ranorex 5.0.2.
Please let us know if you still have problems with Ranorex in connection with Chrome.

Regards,
Bernhard