Robot Framework – Compact Sheet
Abstract: The Robot Ramework is a generic Available Test Libraries
Test Automation Framework for acceptance BuildIn Diff Library
testing. It has a flexible keyword-driven Dialogs Eclipse Library
approach to describe and implement tests. Collections robotframework-faker
OperatingSystem FTP Library
Keywords can be stored in Resource-Files to Remote HTTP Library
separate implementation details from tests. Screenshot iOS Library
Main programming languages for String MongoDB Library
implementing test functionality are Java and Telnet Rammbock
Python. XML RemoteSwingLibrary
Android Library SeleniumLibrary
Anywhere Library Selenium2Library
There are ready-made test libraries available
Appium Library SSH Library
for a lot of technologies. Implementing tests is Archive Library Suds Library
supported by the Robot Framework AutoIt Library Swing Library
IDE(RIDE). Database Library watir-robot
Example – Test Case and Keyword Accessing Test Libraries remotely using XML-RPC
*** Setting ***
Library OperatingSystem
*** Test Case ***
Windows Directory Not Empty
[Documentation] Directory must not be empty.
[Tags] windows directory
${FILENUM}= Number of Files in Directory
Should Not Be Equal As Numbers 0 ${FILENUM}
*** Keywords ***
Number of Files in Directory
${NUM}= Count Files In Directory C:\\WINDOWS
Log ${NUM}
Library org.robot.database.keywords.DatabaseLibrary <- lokal
[Return] ${NUM}
Library Remote http://localhost:8271 <- remote
http://www.robotframework.org pybot|jybot|ipybot [options] data_sources
https://groups.google.com/forum/#!forum/robotframework-users java -jar robotframework.jar [options] data_sources
https://code.google.com/p/robotframework-ride/
www.codecentric.de | blog.codecentric.de | Version 1.0 | 10/10/2014 | [email protected]
Robot Framework – Compact Sheet
Example – Keyword Implementation in Java
public class DatabaseLibrary {
public static final String ROBOT_LIBRARY_SCOPE = "GLOBAL";
private Connection connection = null;
public void connectToDatabase(String driverClassName,
String connectString,
String dbUser,
String dbPassword)
throws SQLException,
InstantiationException,
IllegalAccessException,
ClassNotFoundException {
Class.forName(driverClassName).newInstance();
setConnection(DriverManager.getConnection(connectString,
dbUser,
dbPassword));
RIDE: Graphical User Interface for writing Tests and Keywords.
It supports for example auto-completion and syntax highlighting. }
Allows direct editing of the source files.
public void disconnectFromDatabase() throws SQLException {
getConnection().close();
}
public void tableMustExist(String tableName)
throws SQLException,
DatabaseLibraryException {
DatabaseMetaData dbm = getConnection().getMetaData();
ResultSet rs = dbm.getTables(null, null, tableName, null);
try {
if (!rs.next()) {
throw new DatabaseLibraryException("Table: “ +
tableName +
" was not found");
}
} finally {
rs.close();
}
}
…
www.codecentric.de | blog.codecentric.de | Version 1.0 | 10/10/2014 | [email protected]
Robot Framework – Compact Sheet
Tools Build Support Sample Reports
Rebot - generating logs and reports based on Jenkins PlugIn - To collect and
XML outputs and for combining multiple outputs publish Robot Framework test results
together. in Jenkins.
Libdoc - generating keyword documentation for Maven PlugIn - For using Robot
test libraries and resource files. Framework.
Testdoc - Generates high level HTML Ant Task - For running Robot
documentation based on Robot Framework test Framework tests.
cases.
Tidy - Tool for cleaning up and changing format
of Robot Framework test data files.
Combining Keywords to higher-level Keywords Testing variations using the Generic Testdata Framework AddOn
This AddOn supports testing when a lot of
variations should be tested for one
functionality. For example in ensurance
companies where certain calculations
should be tested with a lot of different input
values and expected results.
It also supports separation of
implementation details from the tests to a
greater degree by allowing Tests to be
written in Excel.
https://github.com/ThomasJaspers/Generic-Testdata-Framework
www.codecentric.de | blog.codecentric.de | Version 1.0 | 10/10/2014 | [email protected]