【问题标题】:Not able to Execute Selenium scripts using Jenkins with latest Firefox browser V59 & Gecko Driver无法使用带有最新 Firefox 浏览器 V59 和 Gecko 驱动程序的 Jenkins 执行 Selenium 脚本
【发布时间】:2018-09-20 17:26:18
【问题描述】:

我目前正在使用 FF 59、Gecko Driver V0.20.1、Windows 10 OS 和 Eclipse 和 Maven。当使用批处理或通过 Eclipse 执行脚本时,脚本在 Firefox 中运行良好,但是当我尝试通过 Jenkins 执行相同操作时,我收到此错误。之前针对 Linux 操作系统提出了同样的问题,其中解决方案说使用 FireFox 57.0 版本。但我不能使用那个版本,我需要使用最新版本来运行我的脚本。尝试执行时,我在 Jenkins 中遇到错误。 Jenkins 不支持最新的 Gecko 驱动程序和 Firefox 版本吗?有没有解决问题的办法。任何建议将不胜感激。 错误:

1523405456958 mozrunner::runner INFO 运行命令:“C:\Program Files (x86)\Mozilla Firefox\firefox.exe”“-marionette”“-profile”“C:\WINDOWS\TEMP\rust_mozprofile.NQCI0vvVeET7”

1523405460671 Marionette INFO 监听 2828 端口

!!! [Parent][MessageChannel] 错误:(msgtype=0x46001C,name=PContent::Msg_PreferenceUpdate) 频道错误:无法发送/接收

!!! [Parent][MessageChannel] 错误:(msgtype=0x2C0001,name=PBrowser::Msg_AsyncMessage) 频道错误:无法发送/接收

JavaScript 错误:chrome://global/content/bindings/remote-browser.xml,第 44 行:NS_ERROR_UNEXPECTED:组件返回失败代码:0x8000ffff (NS_ERROR_UNEXPECTED) [nsIMessageSender.sendAsyncMessage]

【问题讨论】:

    标签: jenkins geckodriver


    【解决方案1】:
    System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir")+"\\geckodriver.exe");
    
            final FirefoxOptions options = new FirefoxOptions();
            System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE, "true");
            options.addPreference("browser.popups.showPopupBlocker", false);
            options.addPreference("security.sandbox.content.level", 5);
    
            WebDriver driver = new FirefoxDriver(options);
    

    【讨论】:

      【解决方案2】:

      仅使用这一行对我有帮助:

      options.addPreference("security.sandbox.content.level", 5);
      

      【讨论】:

      • 这有什么帮助?这背后的原理是什么?
      猜你喜欢
      • 2018-12-31
      • 2018-04-02
      • 1970-01-01
      • 2018-10-04
      • 2017-03-17
      • 2017-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多