Robot Framework--环境搭建
Selenium环境
参考:https://www.cnblogs.com/wilson-5133/p/10717768.html
安装Robot Framework 库
- pip install robotframework
- pip install --upgrade robotframework-seleniumlibrary
安装 Pycharm
参考:https://www.cnblogs.com/wilson-5133/p/9842135.html
Pycharm 中安装插件
- File--Settings
- Plugins--Browse repositories
-
输入框内输入:robot ,并安装以下插件
-
IntelliBot @SeleniumLibrary Patched
-
Robot Framework Support
-
Run Robot framework file
-
Run Robot Framework TestCase
-
执行Robot Framework用例
- 创建 .robot 文件
- 将以下代码粘至 test.robot 文件内,在用例部分右键鼠标,执行 run 操作
*** Settings *** Library SeleniumLibrary *** Test Cases *** 百度搜索robot framework Open Browser http://www.baidu.com chrome Set Selenium Implicit Wait 5 Input Text id=kw robot framework\n ${firstRet}= Get Text id=1 Should Contain ${firstRet} Robot Framework close browser
输出结果如下: