Skip to content
ombre42 edited this page Jun 6, 2012 · 11 revisions

jrobotremoteserver allows you to serve multiple dynamic and static API test libraries without requiring Jython. By making your test library remote, it allows you to have Robot Framework run on a different machine than the test library. It can also be used to overcome compatibility issues (e.g. Selenium & Jython).

Table of Contents

Return Types

Below are the supported return types:

Java type Python type
null string (empty)
String, char[] string
int, Integer, short, Short, byte, Byte int
long, Long string
double, Double, float, Float float
boolean, Boolean bool
List list
array of primitive types except char list
array of <? extends Object> list
Iterable list
Map[1] dict
All others string
[1] All keys are converted to string before returning the Map to Robot Framework.

Parameter Types

The Remote test library that is part of Robot Framework will send arguments as different types depending on the Python type is when the keyword in the remote library is called (it will usually be string). Below you can see what an acceptable Java parameter type for a given Python type is.

Java type Python type
String (will be empty) None
String string
int, Integer int
double, Double float
boolean, Boolean bool
List list, tuple
Object[][1] list, tuple
Map dict
[1] For static API libraries and dynamic API libraries using Javalib Core: if the last parameter is an array-type, then the ArgumentGrouper will convert the arguments to String, thinking you are trying to allow a variable number of arguments. If this is not desired, then declare the parameter as List-type instead.

List and array-type parameters must not declare typing more specific than Object. This is because lists/arrays are sent over XML-RPC with no type information. The runtime class of the elements in the array or list will be the same as if the element was sent as a separate argument.

Dynamic API Libraries

Dynamic libraries are responsible for dispatching run_keyword calls. jrobotremoteserver, therefore, has no way of determining the parameter types. Do not mix arrays and lists because of this. jrobotremoteserver will send array-type (XML-RPC) arguments as arrays first. If that fails due to an IllegalArgumentException, it will convert arrays to ArrayLists and invoke run_Keyword/runKeyword again.

Static API Libraries

Public methods in the test library's class and its super classes are considered keywords. Methods from Object.class that are not overridden are excluded.

Currently, jrobotremoteserver does not support using multiple methods to implement a single keyword as seen the user guide. This is a limitation in Javalib Core, which is what is used to support static API libraries. This is subject to change.

Clone this wiki locally