public static void ClickObject(HtmlControl objectToClick, bool clickToVisible=false) 
 {
     Manager.Current.ActiveBrowser.RefreshDomTree();
     Manager.Current.ActiveBrowser.WaitUntilReady();
     if (clickToVisible)
         objectToClick.ScrollToVisible();
     objectToClick.MouseClick(); 
 }
        public void WebTest3_CodedStep()
        {
            foreach (HtmlTableRow row in Pages.TelerikSample0.InboxTable.Rows)
            {
                // the date will always be in the third cell of the table row
                HtmlControl checkBox = FindElementHelper.FindControlInTableCell(row, "Wed");

                if (checkBox != null)
                {
                    checkBox.ScrollToVisible(); //Make sure we see the object before we click it
                    checkBox.MouseClick();      // MouseClick rather than Click so any existing events will be fired
                }
            }
        }
Ejemplo n.º 3
0
        public void WebTest3_CodedStep()
        {
            foreach (HtmlTableRow row in Pages.TelerikSample0.InboxTable.Rows)
            {
                //                HtmlTableCell c = r.Cells[2]; // the date will always be in the third cell

                //                if (c.TextContent.Contains("Wed"))
                //                {
                //                    HtmlTableCell c1 = r.Cells[0]; // look at the first cell in the row
                //                    HtmlControl checkb = c1.ChildNodes[0].As<HtmlControl>(); // find the checkbox within the cell
                //                    checkb.ScrollToVisible(); //Make sure we see the object before we click it
                //                    checkb.MouseClick();  // MouseClick rather than Click so any existing events will be fired
                //                }

                // the date will always be in the third cell of the table row
                HtmlControl checkBox = FindElementHelper.FindControlInTableCell(row, "Wed");

                if (checkBox != null)
                {
                    checkBox.ScrollToVisible();         //Make sure we see the object before we click it
                    checkBox.MouseClick();              // MouseClick rather than Click so any existing events will be fired
                }
            }
        }