How to import java class, to Robot Framework like library

747 views
Skip to first unread message

stora...@gmail.com

unread,
Jul 25, 2016, 7:01:27 PM7/25/16
to robotframework-devel

I can't understand how to import .jar file, in Robot Framework.

Here is the code:


*** Settings ***
Library   MyLibrary

*** Test Cases ***
My Test
    Do Nothing
    Hello    world


and Java:

public class MyLibrary {

    public void hello(String name) {
        System.out.println("Hello, " + name + "!");
    }

    public void doNothing() {
    }

}


After Extracting in .jar, I put in C:\Python27\Lib\site-packages\MyLibrary and I created empty __init__.py file. After I execute my Robot file with: pybot TestJavaLibrary.robot I get this WARN:

[ WARN ] Imported library 'MyLibrary' contains no keywords.
==============================================================================
TestJavaLibrary
==============================================================================
My Test                                                               | FAIL |
No keyword with name 'Do Nothing' found.


How to use this jar, like external library?


I really get lost here: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#creating-test-libraries

Reply all
Reply to author
Forward
0 new messages