WebElement ScreenRectangle X & Y both = 0

Ask general questions here.
dhale
Posts: 84
Joined: Thu Feb 27, 2014 7:33 pm

WebElement ScreenRectangle X & Y both = 0

Post by dhale » Thu Oct 04, 2018 4:05 pm

Wondering if anyone has an idea on how best to get around a random issue we see sometimes (not all that often really, but its annoying)
Using Ranorex 8.2.1 on a Web page, all C# - not a recording.

We use a RepoItemInfo with WaitForExists, followed by CreateAdapter, then EnsureVisible, with a check for Visible = True, and Enabled = True
Provided all of this passes, finally, we call Focus before performing a MoveTo

Funny thing is that sometimes,the MoveTo goes to 0,0 and I see that the screen rectangle is 0,0 for X & Y

Wondering, is there a way to "refresh" the adapter to get updated info when this happens to get proper webelement data so things work properly?

Right now, I'm going to try re-creating the adapter when I see a screen rectangle of 0,0 to see if that resolves the issue.

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: WebElement ScreenRectangle X & Y both = 0

Post by Stub » Fri Oct 05, 2018 9:24 am

I have very little experience of web automation at this point, but would turning off caching for the repository item help in this case perhaps?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: WebElement ScreenRectangle X & Y both = 0

Post by odklizec » Fri Oct 05, 2018 9:38 am

Hi,

Without seeing the exact code and UI in question (at very least snapshot), it's hard to say what's wrong. I agree with Stub, that it may be helpful to turn the caching OFF for given repo element. But due to the activity of tested UI, it may be required to simply recreate the adapter, before next attempt to click the problematic element?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

dhale
Posts: 84
Joined: Thu Feb 27, 2014 7:33 pm

Re: WebElement ScreenRectangle X & Y both = 0

Post by dhale » Mon Oct 08, 2018 4:14 pm

Caching is off - but the good news is that so far, just re-creating the adapter when X & Y = 0 has seems to have resolved the issue.