Skip to content
Kevin Ormbrek edited this page Mar 8, 2014 · 11 revisions

jrobotremoteserver allows you to serve multiple dynamic and static API test libraries without requiring Jython. If all of your Java code is in remote libraries, you also do not have to execute your tests with jybot, allowing for faster execution. Remote libraries also allow you to have the library running on a different machine than Robot Framework. 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, void 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.

Python type Java type
None String (will be empty)
string String
int int, Integer
float double, Double
bool boolean, Boolean
list, tuple List
list, tuple Object[][1]
dict Map
[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. You may override methods. When there are multiple overloads that take the same number of arguments, the first one that can accept the given values is chosen. Arguments conversion is automatic when possible - e.g. "42" becomes the (int) 42 if the parameter type is int. Overloads that take variable arguments are not supported.

As currently implemented, jrobotremoteserver shares the same limitation for dynamic API libraries with respect to argument types. You cannot mix arrays and Lists as argument types.