could not get a valid element rectangle error

Ask general questions here.
martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

could not get a valid element rectangle error

Post by martinsw » Wed Jun 20, 2012 9:23 am

Dear Ranorex,

can you help me understand why I would be getting a "could not get a valid element rectangle since the element is no longer valid" error when my automation attempts to perform a click on an element in my web application?

There are two things which are confusing me about this error:

(1) The Xpath for the element in question is correct. i.e. when I go into my repository after getting the error and click on "highlight element" the element is successfully highlighted on the web page (tested this on all suppoerted browsers).

(2) The error does not occur consistently - i.e. sometimes my automation runs and this error doesn't occur. So I want to understand what is happening when it does occur so I can make the necessary modifications to the automation so that it runs successfully on a consistent basis. Because the error does not happen consistently, reproducing it on demand may be difficult.

The operating system that my test runs on is windows xp with service pack 3
I am using Ranorex version 3.3 (although I have experienced this same error using previous Ranorex versions)
I have attached the Ranorex report where the error occurred (scroll down to the iteration 3 of the Browser Selection Test Case and expand Page Validation --> Users Page --> Validate Users Page tooltip.
I have also attached a snapshot of the application using spy.

The xpath I use to identify the element is:

/dom[@domain=$var_domain]/body/form/div/div/div/div/div/table/thead/tr/td/input[@id='ctl00_ContentPlaceHolder_UsersGrid_ctl00_ctl02_ctl02_Filter_UserCode' or @id='ctl00_ContentPlaceHolder_CustomersGrid_ctl00_ctl02_ctl02_Filter_CustomerCode']

This error has also occurred (again, on an inconsistent basis) with other elements in my application so I am keen to know the cause and find a fix

Please let me know if you require any additional information to help with your investigation

Many thanks.

Martin
Attachments
error.zip
(497.42 KiB) Downloaded 223 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: could not get a valid element rectangle error

Post by Support Team » Thu Jun 21, 2012 1:51 pm

Hi,

looks like your element is not valid at some specific scenarios in your web application.
Maybe this is a timing issue.
You can try to add a delay before accessing the specific element at the point you are going to run into the warning.

Regards,
Tobias
Ranorex Team
.
Image

amenon
Posts: 2
Joined: Thu Sep 18, 2014 2:43 pm

Re: could not get a valid element rectangle error

Post by amenon » Thu Oct 09, 2014 10:50 am

I have been facing this issue intermittently .However, this issue has occurred only after upgrading to 5.1.x. It comes up at random places and for random XPaths.

I would like to know whether there is any solution other than adding delay because we have a huge number of libraries and Xpaths, which we were using on 4.0.x, and adding delays would not be feasible.

Also, we have been impacted a lot by this error as it comes up at random places and causes a lot of failures.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: could not get a valid element rectangle error

Post by Support Team » Fri Oct 10, 2014 1:56 pm

Hi Amenon,

May I ask you to send us a report of a test run where you faced such issues?
This helps us to get a better understanding for the issue!
May I also ask you to give us more information on your test solution?
Do you work with Recordings or also in Code?
Do you use the Ranorex repository or do you use other ways to get your elements?
If you use the repository do you also use Caching (Use Cache property of folders set to true)?
Which browsers and browser versions do you use and do you use the latest Ranorex version (5.1.3)?

Regards,
Markus
.
Image