Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
242 views
in Technique[技术] by (71.8m points)

c# - Firefox 53 launched with gecko 0.16.1 but fail to connect to internet

I'm using the following configuration:

  • Win 10 64-bit
  • VS Enterprise 2017
  • C# testing project
  • Firefox 53.0.3 (64-bit)
  • Gecko driver geckodriver-v0.16.1-win64
  • Selenium.WebDriver v3.4.0

and this snippet:

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");
        }
    }
}

When I run this program the Gecko driver starts and displays this:

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

A Firefox page is opened but after a while a timeout error is displayed:

timeout

Could you please tell me what I did wrong?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
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/");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...