日期:2014-05-20  浏览次数:20882 次

使用Robot Framework集成Selenium的自动化测试(一)
换了一个新的项目,使用Robot framework 集成selenium做自动化测试,打算首先把本地的环境搭建起来。

第一步: 下载使用的Robot Framework和相关的


首先是Python(如果没有它,在安装Robot的时候会报错)
引用

No Python Installation found in registry

同时在Robot的文档上面很明确的说明了,在服务器上Python基本是默认就安装了,但是在WINDOW你需要自己下载并安装
引用
On most UNIX-like systems such as Linux and OSX you have Python installed by default. If you are on Windows or otherwise need to install Python yourself, your best place to start is http://python.org. There you can download a suitable installer and get more information about the installation process and Python in general.

我这里下的是2.7.3的版本python-2.7.3.amd64.msi


其实需要下载的是Jython,文档里面的描述如下,如果你是使用JAVA环境开发的话需要下载并安装Jython的,如果你是.net是需要IronPython的

引用
Robot Framework is implemented with Python and also runs on Jython (JVM) and IronPython (.NET) interpreters. Before installing the framework, an obvious precondition is installing the needed interpreters.

我这里下载的Jython的版本是jython-installer-2.5.4-rc1.jar


然后才是Robot Framework和selenium的下载地址
Robot Framework
http://code.google.com/p/robotframework/downloads/list
然后选择robotframework-2.7.7.win-amd64.exe

selenium
http://code.google.com/p/robotframework-seleniumlibrary/downloads/list
robotframework-seleniumlibrary-2.9.1.win-amd64.exe

安装完成以后,我是全部装在C盘的。会有两个文件一个是Python27一个是Jython的
在Python27/Lib/site-packages/下面有robot和selenium的文件夹


第二步设置环境变量。
先设置Jython的C:\jython2.5.4rc1\bin;
然后是Python的C:\Python27;C:\Python27\Scripts;
完成以后分别在cmd里面查看是否设置成功jython --version| pybot -help

第三步启动selenium-server.jar,结果如下:


通过这几步基本就算完成了环境的配置,余下的任务就是写测试文件了