Item 'xxxxxx' is no Table

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
niteshr
Posts: 18
Joined: Fri Jul 11, 2014 7:41 am

Item 'xxxxxx' is no Table

Post by niteshr » Wed Jul 22, 2015 7:46 am

Hi Guys,

I have used the spy tool to track an HTML table element. When I try to reference it through code like so:

var PTable = repo.PlayerTable;

I get an error:

Item 'Repository.PlayerTable' is no Table.

I am able to highlight the element etc in the spy.

How do I get past this issue?

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

Re: Item 'xxxxxx' is no Table

Post by odklizec » Wed Jul 22, 2015 7:53 am

Hi,

It's very hard (if not impossible) to help you without some more details about your HTML code and Ranorex solution.

Please provide the following details:
Your Ranorex version (most recent is 5.4, if you are using older version, try the latest one)
Please publish Ranorex Snapshot (not screenshot!) of the table in question. If you cannot publish the snapshot from your production app, try to simulate the problem for example > here < and publish the necessary HTML code.
Sample Ranorex solution with your code and repository would be very helpful too.
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

cwmiller
Posts: 2
Joined: Thu Aug 13, 2015 5:04 pm

Re: Item 'xxxxxx' is no Table

Post by cwmiller » Thu Aug 13, 2015 5:57 pm

I had attempted to reply before but it didn't show up in the thread or my posts so sorry if this is a duplicate.

So I have this table in my repository:
RepoTable.PNG
Right now I'm only attempting to count the rows of this table. The table and its child elements are select-able.

I was trying numerous versions of:

Code: Select all

Table t = new Table(repo.ArrowEnVisionHome.RefTable.Self.Element);
return t.Rows.Count;
However I noticed that RefTable.Self returns a Table by default. So any user code operation on this object will encounter this error.

Snapshot:
TableSnapshot.rxsnp
Ranorex Version: 5.4.0.24580
OS: Windows 8.1 Pro
HW Config: Docked laptop?
You do not have the required permissions to view the files attached to this post.

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

Re: Item 'xxxxxx' is no Table

Post by odklizec » Fri Aug 14, 2015 8:57 am

Hi,

For HTML table, you should use TableTag instead of Table adapter! So the code for obtaining HTML table rows should look like this:
Ranorex.TableTag htmlTable = new Ranorex.TableTag(repo.ArrowEnVisionHome.RefTable);
IList<TrTag> iListTableRows = htmlTable.FindDescendants<TrTag>();
int tableRowsCount = iListTableRows.Count;
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

cwmiller
Posts: 2
Joined: Thu Aug 13, 2015 5:04 pm

Re: Item 'xxxxxx' is no Table

Post by cwmiller » Fri Aug 14, 2015 5:05 pm

I suspected something like that. Though, I still cannot directly access the element and cast it to a TableTag since Ranorex by default tries to return it as a Table.
Base-Table.PNG
Self-Table.PNG
I just did the following to get around it:

Code: Select all

return repo.ArrowEnVisionHome.Self.FindSingle(repo.ArrowEnVisionHome.RefTable.BasePath).FindSingle(@"./tbody").Find(@"./tr").Count;
You do not have the required permissions to view the files attached to this post.

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

Re: Item 'xxxxxx' is no Table

Post by Support Team » Thu Aug 20, 2015 5:03 pm

Hi,

The easiest way would be changing the Adapter Type of the corresponding repository item to tabletag.
Just select the table's repository item and open the properties tab and select tabletag as the Adapter Type as you can see below:
TableTag.png
Regards,
Markus
You do not have the required permissions to view the files attached to this post.