Firefox 53使用gecko 0.16.1启动,但无法连接到Internet [英] Firefox 53 launched with gecko 0.16.1 but fail to connect to internet

查看:84
本文介绍了Firefox 53使用gecko 0.16.1启动,但无法连接到Internet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下配置:

  • 赢得10个64位元
  • VS Enterprise 2017
  • C#测试项目
  • Firefox 53.0.3(64位)
  • Gecko驱动程序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");
        }
    }
}

当我运行该程序时,Gecko驱动程序将启动并显示以下内容:

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 Files\Mozilla Firefox\firefox.exe with args ["-marionette"]

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页面,但过一会儿显示超时错误:

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

能告诉我我做错了什么吗?

Could you please tell me what I did wrong?

推荐答案

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

这篇关于Firefox 53使用gecko 0.16.1启动,但无法连接到Internet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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