【发布时间】:2019-12-25 09:02:39
【问题描述】:
我是 Robotframework 的新手,编写了我的第一个 selenium 测试并遇到了一个问题,即我无法使用机器人框架的“打开浏览器”命令打开浏览器。它给了我错误“chromedrvier 可执行文件需要在 PATH 中”。我在 PATH 中有 chromedriver,我可以使用终端运行 chromdriver,而无需导航到 bin 文件夹。
给我错误的代码:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
SeleniumTestCase
Open Browser https://www.google.com chrome
Wait Until Element Is Visible name=q
Input Text name=q weRplay
Wait Until Element Is Visible name=btnK
Click Button name=btnK
Sleep 3
Close All Browsers
适合我的代码:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
SeleniumTestCase
Create Webdriver Chrome executable_path=/usr/local/bin/chromedriver
Go To https://www.google.com
Wait Until Element Is Visible name=q
Input Text name=q weRplay
Wait Until Element Is Visible name=btnK
Click Button name=btnK
Sleep 3
Close All Browsers
我正在使用以下工具:
- MacOS 莫哈韦沙漠
- Eclipse 2019
- 红色
- 机器人框架
- 机器人框架
- 硒库
【问题讨论】:
-
看看这里有没有答案...stackoverflow.com/questions/38173541/…
标签: eclipse selenium-chromedriver robotframework macos-mojave