示例#1
0
 public static void SelectControlInBrowserByCustom(IE ie, string strCustomAttribute, string strToFind,
                                                   Enumerators.ControlType ctrl)
 {
     if (ctrl == Enumerators.ControlType.Image)
     {
         Image imgCtrl =
             (Image)FindControlInBrowserByCustom(ie, strCustomAttribute, strToFind, Enumerators.ControlType.Image);
         imgCtrl.Click();
     }
     else if (ctrl == Enumerators.ControlType.TableCell)
     {
         TableCell tblCell =
             (TableCell)FindControlInBrowserByCustom(ie, strCustomAttribute, strToFind, Enumerators.ControlType.TableCell);
         tblCell.Click();
     }
     else if (ctrl == Enumerators.ControlType.Link)
     {
         Link lnkToSelect =
             (Link)FindControlInBrowserByCustom(ie, strCustomAttribute, strToFind, Enumerators.ControlType.Link);
         lnkToSelect.Click();
     }
     else if (ctrl == Enumerators.ControlType.CheckBox)
     {
         CheckBox chkToClick =
             (CheckBox)FindControlInBrowserByCustom(ie, strCustomAttribute, strToFind, Enumerators.ControlType.CheckBox);
         chkToClick.Click();
     }
     else if (ctrl == Enumerators.ControlType.Div)
     {
         Div divToClick = (Div)FindControlInBrowserByCustom(ie, strCustomAttribute, strToFind, Enumerators.ControlType.Div);
         divToClick.Click();
     }
     ie.WaitForComplete();
 }
示例#2
0
 public static void SelectControlInBrowserByID(IE ie, string strID, Enumerators.ControlType ctrl)
 {
     if (ctrl == Enumerators.ControlType.Image)
     {
         Image imgCtrl = (Image)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.Image);
         imgCtrl.Click();
     }
     else if (ctrl == Enumerators.ControlType.TableCell)
     {
         TableCell tblCell = (TableCell)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.TableCell);
         tblCell.Click();
     }
     else if (ctrl == Enumerators.ControlType.Button)
     {
         Button btnToSelect = (Button)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.Button);
         btnToSelect.Click();
     }
     else if (ctrl == Enumerators.ControlType.Link)
     {
         Link lnkSelect = (Link)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.Link);
         lnkSelect.Click();
     }
     else if (ctrl == Enumerators.ControlType.CheckBox)
     {
         CheckBox chkToSelect = (CheckBox)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.CheckBox);
         chkToSelect.Click();
     }
     else if (ctrl == Enumerators.ControlType.Div)
     {
         Div divToSelect = (Div)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.Div);
         divToSelect.Click();
     }
     else if (ctrl == Enumerators.ControlType.Span)
     {
         Span spanToSelect = (Span)FindControlInBrowserByID(ie, strID, Enumerators.ControlType.Span);
         spanToSelect.Click();
     }
     ie.WaitForComplete();
 }