zoukankan      html  css  js  c++  java
  • Jenkins调用selenium找不到webdriver:selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

    jenkins集成web_UI自动化脚本,发送的html报告中显示:   

    selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

    如下图:

    使用Chrome浏览器时,经常会遇到以下报错:浏览器没有调用起来

    通常由两种问题引起的:

    1.ChromeDriver.exe驱动有问题(包括版本,路径等等)

    2.Chrome.exe本身有问题。

    网上搜索的解决方案:三个

    1.指定chromedriver.exe驱动绝对路径

    driver = webdriver.Chrome(r'd:xxxchromedriver.exe')

    2.添加chrome.exe到系统path环境变量

    3.在代码中指定chrome.exe绝对路径。设置binary_location属性

    option = webdriver.ChromeOptions()

    option.binary_location=r'C:UsersAdministratorAppDataLocalGoogleChromeApplicationchrome.exe

    driver = webdriver.Chrome()

    driver.get('https://www.baidu.com')


    以上方案均未解决我的问题,最终解决方案如下:

       原因是:安装的chrome浏览器是在userApp下面,jenkins运行找不到

       解决方法如下两种:

      1.重新安装chrome放在C:Program Files (x86)下面

      C:Program Files (x86)GoogleChromeApplication

      2.【从user下面拷贝整个google文件夹到:C:Program Files (x86)】

  • 相关阅读:
    hibernate 核心包与核心接口介绍
    Maven2 的常用命令
    更改SVN登录用户
    配置修改Eclipse自动生成的注释信息
    hibernate 核心包与核心接口介绍
    hibernatedaosupport的使用
    表单提交
    添加ftp用户,等7788
    php 信息
    ecshop 表结构 (转)
  • 原文地址:https://www.cnblogs.com/caixinxiong/p/12616720.html
Copyright © 2011-2022 走看看