搭建robotframework环境

1、安装rf

  执行命令:pip install robotframework;

2、安装seleniumlibrary库

  执行命令:pip install --upgrade robotframework-seleniumlibrary

3、pycharm中安装插件,使得rf文件可高亮、自动索引关键字等功能

  Pycharm中,点击菜单 file - settings - plugins,在弹出对话框中点击下方按键 Browse Repository在新对话框中,搜索栏里面输入 robot

   安装下图中四个插件:

  


或者通过下载 IntelliBot插件,https://github.com/jcyrss/songqin-testdev/raw/master/others/softwares/intellibot.jar
在Pycharm中,点击菜单 file - settings - plugins
在弹出对话框中 点击下方 按键install plugin from disk
选择下载的jar文件


4、将如下自动化用例拷贝到一个名为baidu.robot的文件中,然后用robot命令行运行一下
*** Settings ***
Library  SeleniumLibrary

*** Test Cases ***
百度搜索松勤
    Open Browser                  http://www.baidu.com    chrome
    Set Selenium Implicit Wait    5
    Input Text                    id=kw                   Python

    ${firstRet}=                  Get Text                id=1
    Should Contain                ${firstRet}             Python

 


原文地址:https://www.cnblogs.com/blogofzxf/p/10469508.html