【问题标题】:Invalid entry size error when using custom firefox profile with selenium-standalone-server将自定义 firefox 配置文件与 selenium-standalone-server 一起使用时出现无效条目大小错误
【发布时间】:2012-02-17 01:03:02
【问题描述】:

我正在尝试使用本地存储的自定义 firefox 配置文件在客户端上启动 remotewebdriver 测试。我没有设置网格,我只是尝试与运行 selenium-standalone-server 的客户端进行通信。

下面的 sn-p 是我初始化 WebDriver 的方式。

DesiredCapabilities caps = new DesiredCapabilities();
FirefoxProfile profile = new FirefoxProfile("path_of_profile");
profile.AcceptUntrstedCertificates = false;
caps.SetCapability("firefox_profile", profile.ToBase64String());
_driver = new RemoteWebDriver(new Uri("http://remoteClientIP:4444/wd/hub"), caps);

当我开始测试时,我收到以下错误: 无效的条目大小(预期为 10485760,但得到了 10289152 字节)

具有以下堆栈跟踪: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(DriverCommand driverCommandToExecute, Dictionary``2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)

【问题讨论】:

    标签: c# firefox webdriver


    【解决方案1】:

    如果您使用 RemoteWebDriver,您需要设置浏览器和版本,以便 Selenium RC 知道要使用哪个浏览器来加载。 尝试将此添加到您的代码中:

        caps = new DesiredCapabilities(browserName, browserVersion, new Platform(PlatformType.Windows));
        caps.SetCapability("firefox_profile", profile.ToBase64String());
    

    【讨论】:

      猜你喜欢
      • 2018-02-01
      • 2017-07-23
      • 1970-01-01
      • 2015-09-03
      • 2019-05-27
      • 1970-01-01
      • 1970-01-01
      • 2012-08-01
      • 2014-02-14
      相关资源
      最近更新 更多