在.NET中使用硒2.0网络驱动器的样本/教程? [英] sample/tutorial of using selenium 2.0 web driver in .net?

查看:106
本文介绍了在.NET中使用硒2.0网络驱动器的样本/教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有使用硒2.0网络驱动程序使用.NET的任何教程/样品?

is there any tutorial/sample for using selenium 2.0 web driver with .net ?

我尝试过寻找,但只能找到Java中,任何关于.NET和硒Web 2.0的驱动程序

I've tried searching but could find only java, nothing about .net and selenium 2.0 web driver

推荐答案

这里的文档在C#中的例子:
<一href=\"http://seleniumhq.org/docs/03_webdriver.html\">http://seleniumhq.org/docs/03_webdriver.html

The docs here has an example in C#: http://seleniumhq.org/docs/03_webdriver.html

using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;

class GoogleSuggest
{

    static void Main(string[] args)
    {
        IWebDriver driver = new FirefoxDriver();

        //Notice navigation is slightly different than the Java version
        //This is because 'get' is a keyword in C#
        driver.Navigate().GoToUrl("http://www.google.com/");
        IWebElement query = driver.FindElement(By.Name("q"));
        query.SendKeys("Cheese");
        System.Console.WriteLine("Page title is: " + driver.Title);
        driver.Quit();
    }

}

这篇关于在.NET中使用硒2.0网络驱动器的样本/教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆