0

I need some help setting up a Robot Framework with Selenium - both standalone. My configuration is Jenkins + RobotFramework + Selenium all in Standalone Mode.

I Want to preconfigure a Job using a test set that is shipped with my self made bundle. In the end I want to make jenkins Job that comes with the selfmade package bundle to something like a automated installation qualification.

Everything starts up fine but my test can not load the selenium libs for web test, my last attemp was the following: -Start Jenkins

java -DJENKINS_HOME="%~dp0\jenkins_home" -jar jenkins.war --httpPort=8081 --webroot="%~dp0\jenkins"

-Start Selenium Server

java -jar selenium-server-standalone-2.42.2.jar 

-Start Robot Job in Jenkins

java -Xbootclasspath/a:selenium-2.45.0/*.jar:selenium-2.45.0/libs/*.jar -jar %JENKINS_HOME%\jenkins_home\robotframework-2.8.7.jar %JENKINS_HOME%\jenkins_home\tests\myTest.txt

Sadly I am facing an error : "Importing test library 'Selenium2Library' failed: ImportError: No module named Selenium2Library" I tried several approaches to get it running.

Because of some preconditions I can not manipulate the contens of the Robot oder any othe .jar Slowly I feel this is impossible.

2 Answers 2

1

Your test obviously requires Selenium2Library which is not a standard RF library and needs to be installed/downloaded separately.

In this case (running RF from standalone jar) you need the java version of Selenium2Library which can be downloaded from here.

If you have all three jars in a directory you could run your tests from that directory like this:

java -cp robotframework-2.8.7.jar;robotframework-selenium2library-java-1.4.0.6-jar-with-dependencies.jar;selenium-server-standalone-2.42.2.jar org.robotframework.RobotFramework  %JENKINS_HOME%\jenkins_home\tests\myTest.txt

(looks like you are on Windows - otherwise use : as classpath separator)

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

1 Comment

Yes I am on windows - I also found out a different solution, I will also try the way you mentioned.
0

I simply unpacked the selenium .tar package and took out the Libs and put them into %jenkins_home%\Lib\SeleniumLibrary\ This worked for me.

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.