RED:是基于Eclipse的RobotFramework测试用例编辑器,是robotframework-ride的“升级版”,详细见官方文档:http://nokia.github.io/RED/help/
一.安装与配置
PS:此处java环境和python环境的配置环境变量不作详细介绍
1.安装Java:jdk 1.8:https://www.java.com/zh_CN/
2.安装python环境(python2.7、wxpython、pip、相关库)地址:https://www.python.org/downloads/
2.安装robotframework 3.0.4(pip install robotframeowrk)
4.安装Eclipse:https://www.eclipse.org/downloads/
5.相关driverserver,放在python目录下
ie:https://www.nuget.org/packages/Selenium.WebDriver.IEDriver/
Mozilla GeckoDriver(Firefox) :https://github.com/mozilla/geckodriver/releases
Google Chrome Driver :http://chromedriver.storage.googleapis.com/index.html
Microsoft Edge Driver(新版IE):https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
6.在eclipse中安装RED:
- 启动Eclipse,打开Help - > Eclipse Marketplace
- 搜索“RED Robot Editor”
- 安装首选版本接受许可证
- 重新启动Eclipse以应用更改
或者
- 打开Help -> Install New Software, 点击'Add',设置Name为“RED”,Location为“http://master.dl.sourceforge.net/project/red-robot-editor/repository”
-
在此界面点击select ALL,点击next,之后安装即可
二.Eclipse之完美汉化
- 首先查看eclipse的版本:一般选择对应版本。
- 在菜单栏 help -> install new software… 中点击add,弹出对话框在name中随意写,location输入对应版本的下载包, 下载包为在http://www.eclipse.org/babel/downloads.php页面上选择对应版本。这里我选择的是neon版本的地址
- 然后点击ok,页面出现pending后,软件检索到的语言包列表,下拉垂直滚动条,选择“for eclipse”下的Chinese Simplified(简体中文)包,点击“next”按钮进入下一步。
- 然后,弹出对话框,点击“next”按钮进入下一页面,勾选第一个“I accept…”单选框,点击“Finish”按钮完成设置。
- 然后弹出“正在安装”窗体,用户等待片刻后,在弹出的“Security Warning”窗体中点击“OK”按钮,之后在弹出的又一窗体“Software Updates”中点击“Restart Now”按钮完成语言包的安装并重启eclipse。
- 如果重启后还是没有汉化成功,则可以手动启动,点击help -> install new software ...点击Manage,选中汉化包,保存应用,重启即可(这里我已经汉化)
三.配置RF标识、关键字、变量的自动补全
windows-preference-RobotFramework-Editor-Content Assitant 加上如下内容: [email protected]&*:
即可见
四.项目导入
1.导入已有项目
点击文件-open projects from File System..选择要导入的已有的项目,将项目转换为robot project:右键project-Robot Framework-Configure as Robot project
2.导入第三方库
- 方法一:
借助eclipse的快速修正(快捷键:ctrl+1)导入缺失的第三方库,,双击discover ‘test’ and add to confiduration ,再ctrl+s 保存操作即可,如下图:
非 Eclipse的RobotFramework测试用例编辑器基于Eclipse的RobotFramework测试用例编辑器
- 方法二:
通过red.xml文件的referenced libraries界面导入第三方库,如图:
ps:导入第三方库,一直有黄色感叹号出现,尚未找到原因