本文整理汇总了C#中IWebDriver.ContainsText方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.ContainsText方法的具体用法?C# IWebDriver.ContainsText怎么用?C# IWebDriver.ContainsText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.ContainsText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpecifyForBrowser
public override void SpecifyForBrowser(IWebDriver browser)
{
ignoreIfInternetExplorer("For some reason Internet Explorer won't open a new window from this test.");
given("a webpage that opens another window", delegate()
{
var server = beforeAll(() => new StaticServer()
{
{"first.html", "<html>original window here<a href='/second.html' target='_blank'>hi</a></html>"},
{"second.html", "<html>new window here</html>"}
}.Start());
beforeAll(() => server.Start());
arrange(() => browser.Navigate().GoToUrl(server.UrlFor("first.html")));
var existingWindows = arrange(() => new WhichWindowContext(browser));
when("the new window link is clicked", delegate()
{
arrange(() => browser.FindElement(By.TagName("a")).Click());
arrange(delegate()
{
browser.SwitchTo().Window(existingWindows.GetNewWindowName());
expect(() => browser.ContainsText("new window here"));
});
then("the new window can be switch to", delegate()
{
});
then("the original window can be switched back to", delegate()
{
browser.SwitchTo().Window(existingWindows.GetOriginalWindowName());
expect(() => browser.ContainsText("original window here"));
});
});
});
}