pycharm下robot framework环境搭建

一、安装步骤

1、首先安装python运行环境,我用的2.7版本,当然也有更高的版本,不过安装其他插件的过程中,出现版本问题,所以用了2.7。

2、安装pip(python包管理工具)  https://pip.pypa.io/en/latest/index.html  进入下载get-pip.by文件,进入控制台执行easy_install pip安装pip,以下命令都是控制台执行

3、安装robot framework,执行pip install robotframework

4、安装robotframework-ride,执行pip install robotframework-ride

5、安装selenium2library,执行pip install robotframework-selenium2library

6、安装decorator-3.3.3.tar,执行pip install decorator

7、安装selenium,执行pip installselenium

8、安装PythonIDE  pycharm

9、在pycharm中配置intelliBot

如图所示,我们通过File-settings来打开设置面板,然后按照图中步骤来下载这个插件,然后重启pycharm

img_beb28be9519e5eb00c969a400dc6d4cb.png
1

10、在pycharm中配置RF的文件类型识别

还是打开设置面板,如图所示来配置一下(因为RF的文件,我们在ide中设置的是txt格式,所以我们添加*.txt,如果你设置的是其他格式,那就添加其他格式就好了)

img_3a7a13fba872aba1ac3b1c2be326159a.png
2

11、在pycharm中配置suite和case的运行配置

①配置suite

Robot Run TestSuite

-d results $FileName$

$FileDir$

img_07dfbec964a2805d724a27c87731475e.png
3

②设置case

Robot Run SingleTestCase

-d results -t "$SelectedText$" ./

$FileDir$

img_ab07c73c390f5d59cc2c2d6045262134.png
4

12、运行RF脚本

我们打开已经导入的脚本文件,通过右键调出编辑菜单,然后通过external来运行test_suite.txt

*** Settings ***

Library          Selenium2Library

*** Test Cases ***

test01

[Documentation]    测试淘宝

Open Browser    https://login.taobao.com/member/login.jhtml    chrome

Click Element    xpath=//*[@id="J_Quick2Static"]

Sleep    1

Input Text    xpath=//*[@id="TPL_username_1"]    123

Input Text    xpath=//*[@id="TPL_password_1"]    123

${title_1}    Get Title

Click Button    xpath=//*[@id="J_SubmitStatic"]

Sleep    2

${title_2}    Get Title

should not contain    ${title_2}    ${title_1}

Close browser

13、运行结果

img_75c2c90da2aaedfd975088341b59b794.png
5

这样,我们就成功通过pycharm运行了RF脚本!RF持续更新中。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值