简体   繁体   English

在CentOS上运行基于python硒的测试用例时,错误chromedriver可执行文件需要位于PATH中

[英]Error chromedriver executable need s to be in PATH while running python selenium based test case on CentOS

I am getting error on CentOS while running python selenium based test cases. 运行基于python硒的测试用例时,在CentOS上出现错误。 How can I overcome this issue? 我该如何克服这个问题?

Error is : 错误是:

 Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

I am using below code in my main python file. 我在主python文件中使用以下代码。

    self.options = Options()
    self.options.set_headless(headless=True)
    self.driver = webdriver.Chrome(options=self.options, executable_path='./chromedriver')

尝试使用.exe给出完整路径:

self.driver = webdriver.Chrome(options=self.options, executable_path='./chromedriver.exe')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM