So I am following the code examples on the Ranorex tutorial for use of tables.
I try using the table object to list the elements of a table.
The site of the table grid: //trirand.com/blog/jqgrid/jqgrid.html
Under grouping and then under hide grouping
Here is the object and ranorex xpath
Table t = "/dom[@domain='trirand.com']//table[#'list482']";
I get this error:
The element does not support the required capability 'table'.
Now it works for table tag but I have to drill down to the table elements. Why can't I just use the table object and just for loop through the elements?
Table object in Ranorex
Re: Table object in Ranorex
Technically it is NOT a table, but a tabletag object, so it cannot use the table adapter. If you manually create an object (as opposed to using the instant tracking option or recording, etc.) in the repository and it is a tabletag element, you will need to use the "/tabletag[]" adapter in the RanoreXPath, or change the adapter type in properties to "tabletag".
In code it should be:
And you can loop through the elements if you do a find on the XPath you want.
You have to remember that HTML is not the same as standard code, so the structure is different. There is nothing Ranorex can do about that, they just give us the tools to work with it.
In code it should be:
Code: Select all
TableTag t = "/dom[@domain='trirand.com']//table[#'list482']";
Code: Select all
foreach (TrTag tr in t.Find<TrTag>("tr[@myID='whatever you use to id the row']") {
//do whatever you want with the tr here...
}
Shortcuts usually aren't...