安装 如下 RF使用中需要的工具和库
- RF
在Python中安装 robotframework
#执行命令
pip install robotframework
- seleniumlibrary
在Python中安装 seleniumlibrary
#执行命令
pip install --upgrade robotframework-seleniumlibrary
3.pycharm安装插件
在Pycharm中,点击菜单 file - settings - plugins
在弹出对话框中 点击下方 按键 Browse Repository
在新对话框中, 搜索栏里面输入 robot
安装 下面1个插件
IntelliBot @SeleniumLibrary Patched
下载 IntelliBot插件,百度网盘下载地址:
链接:https://pan.baidu.com/s/1nrcDBArfkX6WQmzjc6RUFw
密码:sub9
在Pycharm中,点击菜单 file - settings - plugins
在弹出对话框中 点击下方 按键install plugin from disk
选择下载的jar文件
将如下 自动化用例 拷贝到 一个 名为 xxx.robot的文件中,然后用 robot命令行 运行一下
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
用例1
#用例主体部分令起一行
log to console hello robot
用例2
Open Browser http://www.baidu.com chrome
set selenium implicit wait 10
input text id=kw 苍井空\n
${res} get text xpath=//*[@id='1']//em
should contain ${res} 苍井空
close Browser
网友评论