public override bool Execute(Command _com) { fakeDb DBase = new fakeDb(); string strType = DBase.GetList(_com.getObject())[0]; string strFirst = DBase.GetList(_com.getObject())[1]; string strSecond = DBase.GetList(_com.getObject())[2]; string strThird = DBase.GetList(_com.getObject())[3]; string strFourth = DBase.GetList(_com.getObject())[4]; IE Iexp = Singleton.Instance("i").getIE(); if (String.Compare(strType, "FRbNA_LIbUR") == 0) { Iexp.Frame(Find.ByName(strFirst)).Link(Find.ByUrl(strSecond)).Click(); } else if (String.Compare(strType, "FRbNA_LIbNA") == 0) { Iexp.Frame(Find.ByName(strFirst)).Link(Find.ByName(strSecond)).Click(); } else if (String.Compare(strType, "FRbNA_FObNA_LIbID") == 0) { Iexp.Frame(Find.ByName(strFirst)).Form(Find.ByName(strSecond)).Link(Find.ById(strThird)).Click(); } else if (String.Compare(strType, "FRbNA_FObNA_BUbID") == 0) { Iexp.Frame(Find.ByName(strFirst)).Form(Find.ByName(strSecond)).Button(Find.ById(strThird)).Click(); } else if (String.Compare(strType, "FRbNA_FRbNA_FObNA_CHbNA") == 0) { //Iexp.Frame(Find.ByName(strFirst)).Frame(Find.ByName(strSecond)).Form(Find.ByName(strThird)).CheckBox(Find.ByName(strFourth)).Checked = true; //Iexp.Frame(Find.ByName(strFirst)).Form(Find.ByName(strThird)).Table(Find.ByName("scrollTable")).CheckBox(Find.ByName(strFourth)).Checked = true; Iexp.Frame(Find.ByName("functionFrame")).CheckBox(Find.ByName("Sel0")).Checked = true; } return(true); }
public void DoesFrameCodeWorkIfTwoBrowsersWithFramesAreOpen() { using (var ie2 = new IE(FramesetURI)) { var contentsFrame = ie2.Frame(Find.ByName("contents")); Assert.IsFalse(contentsFrame.Html.StartsWith("<FRAMESET"), "inner html of frame is expected"); } }
public void DoesFrameCodeWorkIfTwoBrowsersWithFramesAreOpen() { using (var ie2 = new IE(FramesetURI)) { var contentsFrame = ie2.Frame(Find.ByName("contents")); Assert.IsFalse(contentsFrame.Html.StartsWith("<FRAMESET"), "inner html of frame is expected"); } }
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); } }
public static object FindControlInBrowserByCustom(IE ie, string strCustomAttribute, string strToFind, Enumerators.ControlType ctrl) { if (ctrl == Enumerators.ControlType.Span) { Span sp = ie.Span(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(sp.Exists, "Could not Find: " + strToFind); return(sp); } else if (ctrl == Enumerators.ControlType.Link) { Link lnk = ie.Link(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(lnk.Exists, "Could not Find: " + strToFind); return(lnk); } else if (ctrl == Enumerators.ControlType.Frame) { Frame frame = ie.Frame(Find.By(strCustomAttribute, strToFind)); Assert.AreEqual(frame.Name, strToFind); return(frame); } else if (ctrl == Enumerators.ControlType.Image) { Image img; if (strCustomAttribute == "src") { img = ie.Image(Find.BySrc(strToFind)); } else { img = ie.Image(Find.By(strCustomAttribute, strToFind)); } Assert.IsTrue(img.Exists, "Could not Find: " + strToFind); return(img); } else if (ctrl == Enumerators.ControlType.TableCell) { TableCell tCell = ie.TableCell(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(tCell.Exists, "Could not Find: " + strToFind); return(tCell); } else if (ctrl == Enumerators.ControlType.Table) { Table tbl = ie.Table(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(tbl.Exists, "Could not Find: " + strToFind); return(tbl); } else if (ctrl == Enumerators.ControlType.TableRow) { TableRow row = ie.TableRow(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(row.Exists, "Could not Find: " + strToFind); return(row); } else if (ctrl == Enumerators.ControlType.CheckBox) { CheckBox chk = ie.CheckBox(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(chk.Exists, "Could not Find: " + strToFind); return(chk); } else if (ctrl == Enumerators.ControlType.Button) { Button btn = ie.Button(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(btn.Exists, "Could not Find: " + strToFind); return(btn); } else if (ctrl == Enumerators.ControlType.TextField) { TextField txt = ie.TextField(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(txt.Exists, "Could not Find: " + strToFind); return(txt); } else if (ctrl == Enumerators.ControlType.SelectList) { SelectList sList = ie.SelectList(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(sList.Exists, "Could not Find: " + strToFind); return(sList); } else if (ctrl == Enumerators.ControlType.Div) { Div div = ie.Div(Find.By(strCustomAttribute, strToFind)); Assert.IsTrue(div.Exists, "Could not Find: " + strToFind); return(div); } else { return(null); } }