本文整理匯總了C#中WatiN.Core.IE.TableRow方法的典型用法代碼示例。如果您正苦於以下問題:C# IE.TableRow方法的具體用法?C# IE.TableRow怎麽用?C# IE.TableRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WatiN.Core.IE
的用法示例。
在下文中一共展示了IE.TableRow方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FindControlInBrowserByID
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;
}
}
示例2: FindControlInBrowserByCustom
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;
}
}