【问题标题】:"Open Browser" command not working for robot framework in Eclipse“打开浏览器”命令不适用于 Eclipse 中的机器人框架
【发布时间】: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
  • 红色
  • 机器人框架
  • 机器人框架
  • 硒库

【问题讨论】:

标签: eclipse selenium-chromedriver robotframework macos-mojave


【解决方案1】:

将 ChromeDriver.exe 放到 C:\..... 的 Python 文件夹中,重启 RED 或 Eclipse。 如果你这样写,它应该可以工作

Open Browser http://www.random.com  ie

【讨论】:

    猜你喜欢
    • 2017-10-17
    • 2020-06-04
    • 2020-10-11
    • 1970-01-01
    • 2017-05-17
    • 1970-01-01
    • 2013-02-07
    • 2020-08-23
    • 2016-09-06
    相关资源
    最近更新 更多