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?
jybot --pythonpath <the_path_to_your_java_classes> your_tests
//e.g.
jybot --pythonpath c:/test-project/target/classes your_tests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With