Could not get a valid element rectangle from - AngularJS app

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
David Zita
Posts: 14
Joined: Thu Mar 31, 2016 1:20 pm

Could not get a valid element rectangle from - AngularJS app

Post by David Zita » Wed Jan 04, 2017 11:15 am

Hi,

I have looked for and checked most of the topics here related to 'Could not get a valid element rectangle from' error and none helped me with my problem.
I have an angularJS web application. In this application there is a table which is being refreshed during time. I have repository item with XPath definition like this: row=.../table/tbody/tr[1]. So basically I want to click on the first row (I gave up on the option of getting row based on some value in som td tag ...). The row may have a CSS class defined, if this is the case, the row is already selected and I don't want to click on it. So I use code like this:

Code: Select all

public void Select_Row()
{
  if (repo.MyApp.Body.Content.Table.Body.FirstRow.Class == null){
    repo.MyApp.Body.Content.Table.Body.FirstRow.Click();
    Report.Info("Mouse", "The first row was clicked");
  }
  else {
    Report.Info("The first row was already selected");
  }
}
When I execute the test, it sometimes goes fine and sometimes (more often) I get the warning(2 lines, one for each line in the code with the item):
10:11:21 Warn Automation Could not get a valid element rectangle from '{TrTag:}', since the element is no longer valid.
10:11:22 Warn Automation Could not get a valid element rectangle from '{TrTag:}', since the element is no longer valid.
The test then clicks in the top left corner, so the rest of the execution fails..

It has similar behaviour in Spy. When I track the row (or any of the <td> in the row), I have few seconds to see the attributes of the children of the row, but after that all information vanish. I have to refresh (update) the element. But whenever I click on Highlight the item from the repository, it works. So how can I achieve the same behaviour during the runtime? I need to refresh/update the element right before the call of click() method (and accessing the class attribute). Or is there another solution?

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 from - AngularJS app

Post by Support Team » Mon Jan 09, 2017 3:52 pm

Hi David,

In order to analyze your issue in more detail, I would like you to send an email to [email protected] with a detailed description of your problem and a Ranorex snapshot of your application attached.
We could arrange a remote session if it is necessary.

I'm looking forward to your email.

Sincerely,
Matthias
.
Image