使用下面的代码检查网站是否使用加载opera中的内容:
def test_opera_compatability(self):
driver = webdriver.Opera("functional_tests/operadriver")
driver.get("https://www.google.com/")
driver.quit()它返回以下错误:
消息:“operadriver”可执行文件需要在路径中。
chrome的类似代码按预期工作,如下所示:
def test_chrome_compatability(self):
driver = webdriver.Chrome('functional_tests/chromedriver')
driver.get("https://www.google.com/")
driver.quit()发布于 2019-11-28 09:09:46
您可以使用键executable_path传递operadriver二进制文件的绝对路径,如下所示:
def test_opera_compatability(self):
driver = webdriver.Opera(executable_path='/path/to/functional_tests/operadriver')
driver.get("https://www.google.com/")
driver.quit()https://stackoverflow.com/questions/59084856
复制相似问题