Sorry for he repeat question - I have looked at some of the other posts related to table iteration and they don't seem to work for me ???
I have a table in an application that I have identified using the Ranorex Repository Track feature. The element is called 'HistoryViewerDataTable' The xpath is below:
/dom[@domain~'[a-z, A-Z]*.workbench.judicial.int.westgroup.com']//table[#'DataTables_Table_2']
The samples I've seem on this forum use the TrTag element to collect the rows in the table. I have attempted to use the following statement. The compile error suggests there is a cast I can use to return the TrTags in a IList collection ???
Code: Select all
IList<TrTag> directDataList = repo.JSA.HistoryViewerDataTable.Children;
Cannot implicitly convert type 'System.Collections.Generic.IList<Ranorex.Unknown>' to 'System.Collections.Generic.IList<Ranorex.TrTag>'. An explicit conversion exists (are you missing a cast?) (CS0266) - C:\Workspace\SummaryRegression\CodeModules\Tests\History\DirectHistoryGeneral.cs:179,34
Code: Select all
foreach(TrTag trTag in directDataList)
{
IList<TrTag> tdTags = trTag.Children;
Report.Info("tdTags count: " + tdTags.Count);
string cited_citing = (new TdTag(tdTags[0].Element)).InnerText;
Report.Info("cited_citing: " + cited_citing);
string serial_number = (new TdTag(tdTags[1].Element)).InnerText;
Report.Info("serial_number: " + serial_number);
}
Chris