本文整理汇总了C#中SeleniumPage.GetPageFillMethod方法的典型用法代码示例。如果您正苦于以下问题:C# SeleniumPage.GetPageFillMethod方法的具体用法?C# SeleniumPage.GetPageFillMethod怎么用?C# SeleniumPage.GetPageFillMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeleniumPage
的用法示例。
在下文中一共展示了SeleniumPage.GetPageFillMethod方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestGetFillMethodForMultipleSelectControl
public void TestGetFillMethodForMultipleSelectControl()
{
var option = new Mock<IWebElement>(MockBehavior.Strict);
option.SetupGet(o => o.Selected).Returns(false);
this.SetupClick(option);
var element = new Mock<IWebElement>(MockBehavior.Strict);
element.SetupGet(e => e.TagName).Returns("select");
element.Setup(e => e.GetAttribute("multiple")).Returns("true");
element.Setup(e => e.FindElements(By.TagName("option")))
.Returns(new ReadOnlyCollection<IWebElement>(new[] { option.Object }));
element.Setup(e => e.FindElements(By.XPath(".//option[normalize-space(.) = \"Selected Item\"]")))
.Returns(new ReadOnlyCollection<IWebElement>(new[] { option.Object }));
var nativePage = new NativePage();
var page = new SeleniumPage(nativePage);
var fillMethod = page.GetPageFillMethod(null);
fillMethod(element.Object, "Selected Item");
element.VerifyAll();
}
示例2: TestGetFillMethodForCheckboxControl
public void TestGetFillMethodForCheckboxControl()
{
var element = new Mock<IWebElement>(MockBehavior.Strict);
element.SetupGet(e => e.TagName).Returns("input");
element.Setup(e => e.GetAttribute("type")).Returns("checkbox");
element.SetupGet(e => e.Selected).Returns(false);
this.SetupClick(element);
var nativePage = new NativePage();
var page = new SeleniumPage(nativePage);
var fillMethod = page.GetPageFillMethod(null);
fillMethod(element.Object, "true");
element.VerifyAll();
}
示例3: TestGetFillMethodForRadioButtonControl
public void TestGetFillMethodForRadioButtonControl()
{
var element = new Mock<IWebElement>(MockBehavior.Strict);
element.SetupGet(e => e.TagName).Returns("input");
element.Setup(e => e.GetAttribute("type")).Returns("radio");
this.SetupClick(element);
var nativePage = new NativePage();
var page = new SeleniumPage(nativePage);
var fillMethod = page.GetPageFillMethod(null);
fillMethod(element.Object, "true");
element.Verify(e => e.Click(), Times.Exactly(2));
element.VerifyAll();
}
示例4: TestGetFillMethodForStandardInputControl
public void TestGetFillMethodForStandardInputControl()
{
var element = new Mock<IWebElement>(MockBehavior.Strict);
element.SetupGet(e => e.TagName).Returns("input");
element.Setup(e => e.GetAttribute("type")).Returns("text");
element.Setup(e => e.SendKeys("Some Text"));
var nativePage = new NativePage();
var page = new SeleniumPage(nativePage);
var fillMethod = page.GetPageFillMethod(null);
fillMethod(element.Object, "Some Text");
element.VerifyAll();
}