机器人框架 - 骑 - 无法打开OpenBrowser - 日志中没有特定内容

时间:2018-05-07 10:02:46

标签: selenium robotframework

我正在尝试在RIDE上运行这个简单的测试,但是如果不给我任何具体细节,我无法弄清楚它是否失败:

乘坐日志

command: pybot.bat --argumentfile c:\users\user\appdata\local\temp\RIDEe2en9t.d\argfile.txt --listener C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:49555:False C:\Python27\Scripts\test\Login\login_suite.robot

========================================================================================================================================================================
Login Suite   

========================================================================================================================================================================

login_user                                                                                                                                                      | FAIL |
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink":"/wd/hub","type":"Standalone","version":"3.11.0","class":"org.openqa.grid.web.servlet.DisplayHelpServlet$DisplayHelpServletConfig"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    [ Message content over the limit has been removed. ]
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>

启动Selenium服务器(standalone-3.11.0) Python版本2.7 环境路径设置为Python27 / Scripts

这是测试代码:

*** Settings ***
Library           SeleniumLibrary

*** Test Cases ***
login_user
    SeleniumLibrary.Open Browser    Google.com    googlechrome
    Maximize Browser Window
    Title Should Be    Google

Chrome的webdriver也设置在Scripts文件夹中,但我也尝试过使用Firefox并获得相同的结果。

1 个答案:

答案 0 :(得分:-1)

编辑:

所以我尝试过这段代码

 *** Settings ***
Library           SeleniumLibrary

*** Test Cases ***
login_user
    SeleniumLibrary.Open Browser    https://google.com    googlechrome
    Maximize Browser Window
    Title Should Be    Google

如果你有

  • 机器人框架
  • RIDE(用于运行机器人文件)

您唯一需要做的就是下载chromedriver。 https://chromedriver.storage.googleapis.com/index.html?path=2.38/

下载后,将chromedriver放入文件夹并将其添加到您的路径中。

解压缩chromedriver后我的方式

Ubuntu的:

 sudo mv chromedriver /usr/local/bin/
 sudo chown root:root /usr/local/bin/chromedriver

视窗:

  • 将chromedriver.exe放入此示例C:\ drivers \
  • 中的文件夹中
  • 按键盘上的Windows按钮,然后键入编辑系统环境变量
  • 在“高级”选项卡下,单击“环境变量”
  • 列表项
  • 在系统变量下找到“路径”,然后单击路径和编辑按钮
  • 点击新建并添加放置chromedriver的路径

在此示例中为C:\ drivers \ chromedriver