引言:什么是RFS——RobotFramework+selenium2library,本系列主要介紹
web自動化驗收測試方面。
== RobotFramework的一些特性==
重用性好,可以利用現有關鍵字來組合新關鍵字;
支持變量;
支持創建基于數據驅動的測試用例。
提供標簽以分類和選擇將被執行的測試用例;
平臺、應用無關;
功能全面,支持WEB測試(
Selenium)、Java GUI 測試,啟動線程、終端、SSH等;
易于擴展,提供了簡單API,用戶可以自定義的基于
Python或者Java的測試庫;
易于集成,提供了命令行接口和基于XML的輸出文件;
易于與版本管理集成;
==RobotFramework的架構方案==
==RobotFramework的中文支持==
由于初始并不支持中文,于是在生成測試報告的時候對于中文的關鍵字無法識別,使用下面的方法可以正常顯示中文。
在[PythonDir]\Lib\site-packages\robot\utils下的encoding.py文件中,找到def _get_output_encoding(): 原來的編碼是’cp437’ 將其改成’ cp936’(簡體中文,gbk) 。
==目前robotFramework支持的測試庫==
下面這些是可以在robotFramework上支持的測試庫,但是要獨立安裝程序。在安裝之后,使用的時候要單獨加載測試庫。
SeleniumLibrary - A web testing library that uses popularSelenium tool internally.
watir-robot - A web testing library that uses popularWatir tool via theremote library interface.
WatinLibrary - A web testing library that usesWatin tool (a .NET port of Watir) via theremote library interface.
SwingLibrary - A Swing GUI testing library.
EclipseLibrary - A library for testing Eclipse RCP applications using SWT widgets.
AutoItLibrary -
Windows GUI testing library that usesAutoIt freeware tool as a driver.
DatabaseLibrary (Java) - A
test library that provides common functionality for testing database contents. Implemented using Java so works only with Jython.
DatabaseLibrary (Python) - Another library for database testing. Implemented with Python and works also on Jython.
SSHLibrary - A test library that enables SSH and SFTP.
HTTP test library using livetest
HTTP test library using Requests
How-To: Sikuli and Robot Framework Integration - This is not really a library but these instructions explain how to integrateSikuli tool with Robot Framework