Ugh
I am using maven plugin (version 1.1.2) to run robot framework (2.7.3) tests and now I would like to use the SSHLibrary to login remote machines. I did try the SSHLibrary first with pybot and did work like a charm. But when moving to maven plugin I did run in to some problems.
To try out new stuff, I did set up a dummy project. To set up, I did use the Maven Integration instructions [1] (which seems to work like a charm). Then I did place SSHLibrary-folder, form SSHLibrary-1.0.tar.gz file [2], to the libraries-folder and also placed trilead-ssh2-build213.jar [3] to the libraries- and SSHLibrary-folders. In practice I have folders like this:
C:\Data\test\smoke-test\src\test\resources\robotframework>ls *
libraries:
SSHLibrary trilead-ssh2-build213.jar
tests:
Smoke_suite.txt
C:\Data\test\smoke-test\src\test\resources\robotframework>ls libraries\SSHLibrary
__init__$py.class connectioncache$py.class pythonclient.py
__init__.py connectioncache.py trilead-ssh2-build213.jar
client$py.class javaclient$py.class
client.py javaclient.py
The test suite is an easy, it uses only the open connection keyword:
*** Settings ***
Library SSHLibrary
*** Test Cases ***
use ssh
Open Connection 192.168.1.1 \ 2025
When I run the mvn clean verify, I get the following error:
==============================================================================
Tests
==============================================================================
[ ERROR ] Error in file 'C:\Data\test\smoke-test\src\test\resources\robotframework\tests\Smoke_suite.txt' in table 'Settings': Importing test library
'SSHLibrary' failed: ImportError: Importing Trilead SSH classes failed. Make sure you have the Trilead jar file in CLASSPATH.
Traceback (most recent call last):
File "C:\Data\test\smoke-test\src\test\resources\robotframework\libraries\SSHLibrary\__init__.py", line 26, in <module>
from javaclient import SSHClient
File "C:\Data\test\smoke-test\src\test\resources\robotframework\libraries\SSHLibrary\javaclient.py", line 22, in <module>
raise ImportError('Importing Trilead SSH classes failed. '
PYTHONPATH:
C:\Data\test\smoke-test\src\test\resources\robotframework\libraries
C:\Data\test\smoke-test\target\classes
C:\Users\aaltat\.m2\repository\org\robotframework\robotframework\2.7.3\robotframework-2.7.3.jar\Lib\robot\libraries
C:\Users\aaltat\.m2\repository\org\robotframework\robotframework\2.7.3\robotframework-2.7.3.jar\Lib
C:\Users\aaltat\.m2\repository\org\robotframework\robotframework\2.7.3\Lib
__classpath__
__pyclasspath__/
.
C:\Data\test\smoke-test
CLASSPATH:
C:\Program Files (x86)\apache-maven-3.0.4\bin\..\boot\plexus-classworlds-2.4.jar
Tests.Smoke suite
==============================================================================
use ssh | FAIL |
No keyword with name 'Open Connection' found.
------------------------------------------------------------------------------
....
Basically what I did gather from error message that it does not found the trilead-ssh2-build213.jar. Based on the SSHLibrary instructions, the jar file should be placed to a folder that is defined under the CLASSPATH. But with maven plugin, I can only use PYTHONPATH. So I suck in the this and could someone point me to right direction how to use SSHLibrary with Maven plugin?
-Tatu
[1]
http://code.google.com/p/robotframework/wiki/MavenIntegration[2]
robotframework-sshlibrary.googlecode.com/files/SSHLibrary-1.0.tar.gz[3]
robotframework-sshlibrary.googlecode.com/files/trilead-ssh2-build213.jar