搭建RobotFrameWork测试环境(Mac版)

才用mac os x不久,很多操作不熟悉,参照下文一边装一边试,最终还是跑起来了。
安装的一些细节和下文有所出入,仅供参考。

系统环境:

* Mac OS X 10.8.3
* 自带 Python 2.7.2

安装 pip, 详见:http://guide.python-distribute.org/installation.html

wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz
tar xzf pip-0.7.2.tar.gz
cd pip-0.7.2sudo python setup.py install



# install distribute

wget http://python-distribute.org/distribute_setup.py



安装 robotframework

wget https://robotframework.googlecode.com/files/robotframework-2.7.7.tar.gz
tar zxvf robotframework-2.7.7.tar.gz
cd robotframework-2.7.7
sudo python setup.py install

# test installation
pybot --version
# install selenium2librarysudo
pip install robotframework-selenium2library


运行测试用例hello.txt
在hello.txt的目录执行命令

pybot hello.txt


robot默认使用Firefox作为启动浏览器,如果要使用其他浏览器(如Chrome),需要安装相应的Driver

wget https://chromedriver.googlecode.com/files/chromedriver2_mac32_0.8.zip
unzip chromedriver2_mac32_0.8.zip
sudo cp chromedriver2_mac32_0.8/chromedriver /usr/bin


通过Python测试Chromedriver:

$ python
>>> from selenium import webdriver
>>> driver = webdriver.Chrome()
>>> driver.get("http://www.google.com")


修改case,重新执行 pybot hello.txt(如果报浏览器找不到错误,尝试重启系统)

Open Browser http://www.google.com Chrome


安装 RobotFramework IDE,参见:https://github.com/robotframework/RIDE/wiki/Installation-Instructions

wget https://robotframework-ride.googlecode.com/files/robotframework-ride-1.1.tar.gz
tar zxvf robotframework-ride-1.1.tar.gz
cd robotframework-ride-1.1
sudo python setup.py install


参考
[list]

* BuiltIn Keywords:http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=2.6.1

* Selenium2Library Keywords:
https://github.com/rtomac/robotframework-selenium2library/blob/master/doc/Selenium2Library.html

* Selenium2Library On GitHub:
https://github.com/rtomac/robotframework-selenium2library

* RIDE Overview:
http://blog.codecentric.de/en/2012/01/robot-framework-ide-ride-overview/

* AutoIt doc:
http://www.jb51.net/shouce/autoit/index.html

[/list]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值