Scan Data on grid is not working

Ranorex Spy, Recorder, and Studio.
yoad
Posts: 39
Joined: Sun May 26, 2013 9:08 am

Scan Data on grid is not working

Post by yoad » Wed Dec 18, 2013 1:12 pm

Hello Support,
Scan is not working on all Data(I Added snapshot file for it)
it is working partial


string headerName = "x-grid-header-row";
                string className = "";
               
//              TableTag someTableTag ="dom[@domain='102.101.100.131:7019']//table[@id~'gridview']//tbody[@id~'gridview']/tr//div[@innertext~'.+']"

//                TableTag someTableTag ="/dom[@domain='102.101.100.131:7019']//div[@id~'gridview']/table";
//                IList<TrTag> rows = someTableTag.FindDescendants<TrTag>();

                IList<DivTag> rows=Host.Local.Find<DivTag>("dom[@domain='102.101.100.131:7019']//table[@id~'gridview']//tbody[@id~'gridview']/tr//div[@innertext~'.+']");
                
                for(int i=0; i<3&&rows.Count>=3; i++)
                {
                               className = rows.Element.GetAttributeValueText("Class");
                               
                               rows.MoveTo();
                               
                               if(className != headerName)
                               {
                                               foreach (DivTag cell in rows.Find("./td/div"))
                                               {
                                                               // Move the mouse to each cell element
 
                                                               if ((string.IsNullOrEmpty(cell.InnerText)))
                                                               {
                                                                              Report.Warn(cell.ToString());
                                                                              
                                                               }
                                                               else
                                                               {
                                                                              Report.Info(cell.ToString());
                                                               }
                                                              
                                                               cell.MoveTo();
                                                               // Set css style
                                                               cell.SetStyle("background-color", "#33ff00");
                                                              
                                               }
                               }
                }


Best Regards,
Yoad
Attachments
TableHTML.rxsnp
(356.17 KiB) Downloaded 128 times
listForTableHTML.rxsnp
(356.87 KiB) Downloaded 132 times

User avatar
BernhardS
Ranorex Guru
Ranorex Guru
Posts: 36
Joined: Tue Dec 17, 2013 6:35 pm

Re: Scan Data on grid is not working

Post by BernhardS » Mon Dec 23, 2013 2:01 pm

Hello Yoad,

Can you please describe in more detail what you are trying to do and what exactly is not working?

Regards,
Bernhard