Selecting an item from tr which has 12 rows.
Posted: Wed Jul 07, 2010 7:24 am
i am facing an problem in selecting an particular row with row number but i was failed to perform because there is no event like Item(VB) in c#.
My code is like
Ranorex.TableTag tagtable = new Ranorex.TableTag (repo.Home.Loss.tblSelect);
Ranorex.TBodyTag tb=tagtable.FindSingle<Ranorex.TBodyTag>("./tbody");
System.Collections.Generic.IList<TrTag> trSel = tb.Find<Ranorex.TrTag>("./tr");
MessageBox.Show(trSel.Count.ToString());
System.Collections.Generic.IList<TdTag> tdSel = tb.Find<Ranorex.TdTag>("./tr/td");
MessageBox.Show(tdSel.Count.ToString());
i can get the count but i cant select an item.
totally tr has 12 rows and td has 140 columns and i want to access the 10row How to get the element in c# ?
Vb code which is working correctly:
Dim progTbl As Ranorex.TableTag = repo.Home.Loss.tblSelect
Dim tb As Ranorex.TBodyTag = progTbl.FindSingle(Of Ranorex.TBodyTag)("./tbody")
Dim tr As System.Collections.Generic.List(Of TrTag)= tb.Find(Of Ranorex.TrTag)("./tr")
Dim td As System.Collections.Generic.List(Of TdTag)= tb.Find(Of Ranorex.TdTag)("./tr/td")
msgbox(td.Count)
msgbox(td.Item(14).InnerText.ToString)
this is working fine but in c# it dosent have an item property which was highlited in red color
My code is like
Ranorex.TableTag tagtable = new Ranorex.TableTag (repo.Home.Loss.tblSelect);
Ranorex.TBodyTag tb=tagtable.FindSingle<Ranorex.TBodyTag>("./tbody");
System.Collections.Generic.IList<TrTag> trSel = tb.Find<Ranorex.TrTag>("./tr");
MessageBox.Show(trSel.Count.ToString());
System.Collections.Generic.IList<TdTag> tdSel = tb.Find<Ranorex.TdTag>("./tr/td");
MessageBox.Show(tdSel.Count.ToString());
i can get the count but i cant select an item.
totally tr has 12 rows and td has 140 columns and i want to access the 10row How to get the element in c# ?
Vb code which is working correctly:
Dim progTbl As Ranorex.TableTag = repo.Home.Loss.tblSelect
Dim tb As Ranorex.TBodyTag = progTbl.FindSingle(Of Ranorex.TBodyTag)("./tbody")
Dim tr As System.Collections.Generic.List(Of TrTag)= tb.Find(Of Ranorex.TrTag)("./tr")
Dim td As System.Collections.Generic.List(Of TdTag)= tb.Find(Of Ranorex.TdTag)("./tr/td")
msgbox(td.Count)
msgbox(td.Item(14).InnerText.ToString)
this is working fine but in c# it dosent have an item property which was highlited in red color