Ejemplo n.º 1
0
        public void UploadVideo(IE ie, string filePath)
        {
            ie.Link(Find.ById("uploadVideo")).Click();

            var fu = ie.FileUpload(Find.ById("ctl00_cphAdmin_txtUploadVideo"));
            fu.Set(filePath);

            ie.Button(Find.ById("ctl00_cphAdmin_btnUploadVideo")).Click();
            ie.WaitForComplete();
        }
Ejemplo n.º 2
0
        public void UploadImage(IE ie, string filePath)
        {
            ie.Link(Find.ById("uploadImage")).Click();

            var fu = ie.FileUpload(Find.ByClass("ImageUpload"));
            fu.Set(filePath);

            ie.Button(Find.ById("ctl00_cphAdmin_btnUploadImage")).Click();
            ie.WaitForComplete();
        }
Ejemplo n.º 3
0
        void SetFileUpload(IE ie, string id, string fileName)
        {
            lock (_setFileLock)
            {
                Thread.Sleep(500);

                ie.FileUpload(id).Set(fileName);

                Thread.Sleep(500);
            }
        }
Ejemplo n.º 4
0
 static void SetFileUpload(IE ie, string id, string fileName)
 {
         ie.FileUpload(id).Set(fileName);
 }
Ejemplo n.º 5
0
 public static object FindControlInBrowserByID(IE ie, string strID, Enumerators.ControlType ctrl)
 {
     if (ctrl == Enumerators.ControlType.Span)
     {
         Span sp = ie.Span(Find.ById(strID));
         Assert.IsTrue(sp.Exists, "Could not Find: " + strID);
         return sp;
     }
     else if (ctrl == Enumerators.ControlType.Link)
     {
         Link lnk = ie.Link(Find.ById(strID));
         Assert.IsTrue(lnk.Exists, "Could not Find: " + strID);
         return lnk;
     }
     else if (ctrl == Enumerators.ControlType.Frame)
     {
         Frame iFrame = ie.Frame(Find.ById(strID));
         return iFrame;
     }
     else if (ctrl == Enumerators.ControlType.Image)
     {
         Image img = ie.Image(Find.ById(strID));
         Assert.IsTrue(img.Exists, "Could not Find: " + strID);
         return img;
     }
     else if (ctrl == Enumerators.ControlType.TableCell)
     {
         TableCell tCell = ie.TableCell(Find.ById(strID));
         Assert.IsTrue(tCell.Exists, "Could not Find: " + strID);
         return tCell;
     }
     else if (ctrl == Enumerators.ControlType.Table)
     {
         Table tbl = ie.Table(Find.ById(strID));
         Assert.IsTrue(tbl.Exists, "Could not Find: " + strID);
         return tbl;
     }
     else if (ctrl == Enumerators.ControlType.TableRow)
     {
         TableRow row = ie.TableRow(Find.ById(strID));
         Assert.IsTrue(row.Exists, "Could not Find: " + strID);
         return row;
     }
     else if (ctrl == Enumerators.ControlType.CheckBox)
     {
         CheckBox chk = ie.CheckBox(Find.ById(strID));
         Assert.IsTrue(chk.Exists, "Could not Find: " + strID);
         return chk;
     }
     else if (ctrl == Enumerators.ControlType.Button)
     {
         Button btn = ie.Button(Find.ById(strID));
         Assert.IsTrue(btn.Exists, "Could not Find: " + strID);
         return btn;
     }
     else if (ctrl == Enumerators.ControlType.TextField)
     {
         TextField txt = ie.TextField(Find.ById(strID));
         Assert.IsTrue(txt.Exists, "Could not Find: " + strID);
         return txt;
     }
     else if (ctrl == Enumerators.ControlType.SelectList)
     {
         SelectList sList = ie.SelectList(Find.ById(strID));
         Assert.IsTrue(sList.Exists, "Could not Find: " + strID);
         return sList;
     }
     else if (ctrl == Enumerators.ControlType.Div)
     {
         Div division = ie.Div(Find.ById(strID));
         Assert.IsTrue(division.Exists, "Could not Find: " + strID);
         return division;
     }
     else if (ctrl == Enumerators.ControlType.TableRow)
     {
         TableRow tRow = ie.TableRow(Find.ById(strID));
         Assert.IsTrue(tRow.Exists, "Could not Find: " + strID);
         return tRow;
     }
     else if (ctrl == Enumerators.ControlType.FileUpload)
     {
         FileUpload fileUpload = ie.FileUpload(Find.ById(strID));
         Assert.IsTrue(fileUpload.Exists, "Could not find: " + strID);
         return fileUpload;
     }
     else
     {
         return null;
     }
 }