2017-06-06 41 views
0

我使用了以下配置:的Firefox 53發佈與壁虎0.16.1但無法連接到互聯網

  • 10場64位
  • VS企業2017年
  • C#檢測項目
  • 火狐53.0.3(64位)
  • 壁虎驅動geckodriver-v0.16.1-Win64的
  • Selenium.WebDriver v3.4.0

這個片斷:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using OpenQA.Selenium; 
using OpenQA.Selenium.Firefox; 

namespace Test 
{ 
    class Program 
    { 
     static void Main(string args) 
     { 
      IWebDriver driver = new FirefoxDriver(); 
      driver.Navigate().GoToUrl("http://www.google.com"); 
     } 
    } 
} 

當我運行此程序的壁虎駕駛員啓動,並顯示如下:

1496673391949 geckodriver INFO Listening on 127.0.0.1:62736 1496673393128 geckodriver::marionette INFO Starting browser \\?\C:\Program Files\Mozilla Firefox\firefox.exe with args ["-marionette"]

而Firefox頁面被打開,但一段時間超時錯誤後顯示:

timeout

你能告訴我我做錯了什麼嗎?

+0

檢查Firefox版本和硒驅動程序和壁虎。檢查它們是否相互兼容。 –

+0

我在ChromeDriver()中使用相同的配置沒有問題。 –

+0

但是你必須檢查Firefox的兼容性 –

回答

0
FirefoxProfile profile = new FirefoxProfile(); 
Proxy proxy = new Proxy(); 
proxy.IsAutoDetect = true; 
profile.SetProxyPreferences(proxy); 
IWebDriver driver = new FirefoxDriver(profile); 
driver.Navigate().GoToUrl("http://www.google.com/"); 
相關問題