问题
I am learning RObotoframework using - Java. With user defined java file I am getting error "Test Library 'mavenPackage.MyKeyWords.java' does not exist".
If I don't use this file, test is running fine. Only for importing my .Java file, I see this error. Please help!
I installed Jython. In my "C:\robotfw" I placed... 1. robotframework-2.8.1.jar 2. robotframework-selenium2library-java-1.2.0.13-jar-with-dependencies 3. I placed the whole Java package folder (mavenPackage) here. Inside of this the .java file exists. (mavenPackage.MyKeywords.java)
I set the Classpath for the 1 and 2 JARS.
testcase.txt
* Settings *
Library Selenium2Library
Library mavenPackage.MyKeywords.java
回答1:
You can't import directly the java file. You must compile it and put it in your classpath according to the package of the class.
In your classpath you need RF jar, selenium jar and your classes.
You don't even need Jython as it is included in RF jar.
来源:https://stackoverflow.com/questions/20320799/robot-framework-user-java-libraries-error-test-library-mavenpackage-mykeywords