Page 1 of 1

WebElement ScreenRectangle X & Y both = 0

Posted: Thu Oct 04, 2018 4:05 pm
by dhale
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.

Re: WebElement ScreenRectangle X & Y both = 0

Posted: Fri Oct 05, 2018 9:24 am
by Stub
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?

Re: WebElement ScreenRectangle X & Y both = 0

Posted: Fri Oct 05, 2018 9:38 am
by odklizec
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?

Re: WebElement ScreenRectangle X & Y both = 0

Posted: Mon Oct 08, 2018 4:14 pm
by dhale
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.