-
Notifications
You must be signed in to change notification settings - Fork 33
User Guide
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).
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 |
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 |
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 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.
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.
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.
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.