本文整理汇总了C#中IE.TextField方法的典型用法代码示例。如果您正苦于以下问题:C# IE.TextField方法的具体用法?C# IE.TextField怎么用?C# IE.TextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IE
的用法示例。
在下文中一共展示了IE.TextField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseLambasSpeedTest
public void UseLambasSpeedTest()
{
using (var ie = new IE(BaseWatiNTest.MainURI))
{
var textFieldStart = ie.TextField(t => t.Name == "TextareaName");
const int numberOfLookUps = 500;
StopWatch stopWatch1 = new StopWatch();
stopWatch1.Start();
for (var i = 0; i < numberOfLookUps; i++)
{
var textField = ie.TextField(t => t.Name == "TextareaName");
Assert.That(textField.Exists);
}
stopWatch1.Stop();
var stopWatch2 = new StopWatch();
stopWatch2.Start();
for (var i = 0; i < numberOfLookUps; i++)
{
var textField = ie.TextField(Find.ByName("TextareaName"));
Assert.That(textField.Exists);
}
stopWatch2.Stop();
Console.WriteLine("1: " + stopWatch1.TicksSpend / numberOfLookUps + " " + stopWatch1.TicksSpend + " " + stopWatch1.TicksSpend / 1000);
Console.WriteLine("2: " + stopWatch1.TicksSpend / numberOfLookUps + " " + stopWatch2.TicksSpend + " " + stopWatch2.TicksSpend / 1000);
}
}
示例2: UsingLambdaExpressionsWithWatiN_1_3
public void UsingLambdaExpressionsWithWatiN_1_3()
{
using (var ie = new IE("www.google.com"))
{
var textField = ie.TextField(t => t.Name == "q");
Assert.That(textField.Name, Is.EqualTo("q"));
}
}
示例3: PressTabAndActiveElement
public void PressTabAndActiveElement()
{
using (var ie = new IE(MainURI))
{
ie.TextField("name").Focus();
var element = ie.ActiveElement;
Assert.AreEqual("name", element.Id);
ie.PressTab();
element = ie.ActiveElement;
Assert.AreEqual("popupid", element.Id);
}
}
示例4: GoogleSearchWithEncodedQueryStringInConstructor
public void GoogleSearchWithEncodedQueryStringInConstructor()
{
var url = string.Format("http://www.google.com/search?q={0}", HttpUtility.UrlEncode("a+b"));
using (var ie = new IE(url))
{
Assert.That(ie.TextField(Find.ByName("q")).Value, Is.EqualTo("a+b"));
}
}