2

I am trying to get a Robot framework in place based on Python. On one side of the test block box is a Python simulator for which I have written test libraries to interact with. On the other side there is a Java library.

I have the following questions on how to interact with Java classes from within the Python based Robot framework:

  • Option A:
    Robot Framework (based on Python) includes both the Python test libraries and Java test libraries seamlessly. After reading through the Robot documentation I do not believe this is possible? Or maybe it’s possible and not clearly mentioned anywhere? My understanding is the user needs Jython in order to include the Java classes in the Robot framework but I am currently using Python.

  • Option B:
    Use the Python test library and include the Java classes using JNI and any possible options (py4j, pyjnius, javbridge etc).

  • Option C:
    I am currently calling the Java executable from within the Python test library with the required option (more like a CLI) and then parsing the logs to match for the test in question.

The last option is working but I would like to know the best approach between these three.

1
  • 1
    Option A: Yes, you definitely have to use jython. Commented Sep 28, 2015 at 11:35

1 Answer 1

1

To directly use keywords written in java, you'll need to use jython.

Another option is to use the remote library interface. You set up a little XML-RPC server (in java), then import the library by giving robot the address of the server.

The good news is that someone has already written a java based server. See https://github.com/ombre42/jrobotremoteserver

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.