vs2010下chromedriver怎么配置啊
using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("http://www.baidu.com");
// IWebDriver driver = new FirefoxDriver();
}
}
}
IWebDriver driver = new ChromeDriver();
报
WebDriverException:
Cannot start the driver service on http://localhost:27784/
没有开启selenium-server.jar。
http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c422461b0239e9ba24201204ce963c215afe170bf7a6613464587ef686c2834ddbb8922f3bcd7a742613d61f4f860eaebb5125b637912ab8ee4fbbadf14284aea5c4de240f9d15127af1aace051715ba65f11733e1a68e48640c50fcb6613ba84e7758c97406e51ca7a1256e768bfdda5a4fc32d&p=8b2a971cc59e1ce01abd9b7e0e11a5&newp=91769a478d9114ff57ed97794a00a5231610db2151d4da156b82c825d7331b001c3bbfb423231303d5c57a6400ae4c5cebf33d73360527a3dda5c91d9fb4c57479d37561&user=baidu&fm=sc&query=http%3A//blog%2Ecsdn%2Enet/hwm831002/article/details/8954125&qid=f3bfa0280014ce31&p1=1
{
网上说不用开启啊。。
1. Selenium Server:和Selenium RC一样的,通过指定远端服务器IP地址和端口号,由这个远端服务器来驱动浏览器。
2. 直接调用:无须指定任何服务器IP地址和端口号。直接使用本地的浏览器(只要安装相应的浏览器,如IE、Firefox、Chrome)
不使用Selenium Server:WebDriver driver = new FirefoxDriver();使用Selenium Server:DesiredCapabilities capabilities = new DesiredCapabilities("firefox", "", Platform.ANY);
WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub/"), capabilities);}
要问的是什么 呀 上来粘一段代码然后说网上不用开启
页:
[1]