The `TestLibrary` has no Keywords so far...To add some just use the `TestLibrary.keyword` decorator:

@TestLibrary.keyword def some_keyword(self, arg, *rest): ...

A keyword function can be defined anywhere in any scope.The `TestLibrary.keyword` decoratoralways links it to the `TestLibrary`(but always returns the original function object).And when called as a Keyword from Robot Frameworkthe `self` parameter will always get the `TestLibrary` instance.

When you apply custom decorators to your Keyword functionswhich don't return the original function objects,you would have to take care of preserving the original argspec for Robot.`testlibrary` can handle this for you:

def some_decorator(func): def wrapper(...): return func(...)

# You still have to take care of the function(-->Keyword) name: wrapper.__name__ = func.__name__ return wrapper

Whenever your Test Library needs to deal with sessions,like network connections,which you want to open, switch, close,and when you don't always want to specifythe actual session to use as a Keyword argument,just do:

`RemoteRobot` is derived from `robottools.TestRobot`and `robotremoteserver.RobotRemoteServer`.The `__init__()` method shares most of its argumentswith `RobotRemoteServer`:

The differences:

* Instead of a single pre-initialized Test Library instance, you can provide a sequence of multiple Test Library names, which will be imported and initialized using `TestRobot.Import()`.* The additional argument `allow_import` takes a sequence of Test Library names, which can later be imported remotely via the `Import Remote Library` Keyword described below.

Once initialized the `RemoteRobot` will immediately start its service.To access it from your Test Scripts,you can use Robot Framework's standard `Remote` Library.Once connected it will provide all the Keywords from the Test Librariesimported by the `RemoteRobot`.Besides `RobotRemoteServer`'s additional `Stop Remote Server` Keyword`RemoteRobot` further provides these extra Keywords:

* `Import Remote Library [ name ]`

After using this Keyword the `Remote` Library must be reloaded to make the new Keywords accessible. You can do this via `ToolsLibrary.Reload Library`.

5. Using the ToolsLibrary-------------------------[5]: #markdown-header-5-using-the-toolslibrary

The `ToolsLibrary` is a Dynamic Test Library,which provides these additional general purpose Keywords:

* `Reload Library [ name | *args]`

The `ToolsLibrary` is based on `robottools.testlibrary`.To use it directly in __Python__:

from ToolsLibrary import ToolsLibrary

tools = ToolsLibrary()

Then you can call the Keywords in `tools.CamelCase(...)` style.

6. Using IPython as a Robot Framework shell-------------------------------------------[6]: #markdown-header-6-using-ipython-as-a-robot-framework-shell

In : %load_ext robotshell

Now all the `robottools.TestRobot` functionalityis exposed as IPython `%magic` functions...

[Robot.Default] In : %Import SomeLibrary Out: [Library] SomeLibrary

As with a `robottools.TestRobot` you can call Keywordswith or without the Test Library prefix.You can simply assign the return values to normal Python variables.And there are two ways of separating the arguments:

If a Keyword fails the traceback is just printed like in a Robot Log.If it fails unexpectedly you may want to debug it.Just turn on `%robot_debug` modeand the Keyword's exception will be re-raised.Combine it with IPython's automatic `%pdb` modeand you'll get a nice Test Library debugging environment.

This way you can also pass Python variables directly to a Robot Keyword.If the `Robot` can't find the variable in its own dictionary,lookup is first extended to IPython's `user_ns` (shell level)and finally to Python's `builtins`.