• 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)】

  • 相关阅读:
    svn备份
    Java Web开发引用包的方法
    nucht1.2二次开发增量采集
    程序集信息设置.net
    lucene的基本查询及lucene3.0.1API
    Asp.net网站部署
    C语言面试算法题(一)
    面试题
    C语言面试算法题(二)
    C++的IO流的函数
  • 原文地址:https://www.cnblogs.com/caixinxiong/p/12616720.html
Copyright © 2020-2023  润新知