1
votes

I've got a Selenium stand alone server, I run a simple test suite with a simple test case in command line and it works, here is the command line :

java -jar D:\POC\selenium-server-standalone-2.45.0.jar -Dhttp.proxyHost=XXXX -Dhttp.proxyPort=8080 -Dhttp.proxyUser=XXXX -Dhttp.proxyPassword=XXXX -htmlSuite *firefox http://XXXXX D:\Users\XXXX\Desktop\test_selenium.html D:\Users\XXXX\Desktop\result_selenium.html -firefoxProfileTemplate "C:\Users\XXXXX\AppData\Roaming\Mozilla\Firefox\Profiles\1yd4vpna.selenium" -debug

The same command is used by jenkins to run the test, here is the selenium result file :

info: Starting test /selenium-server/tests/test_case_selenium.html info: Executing: |open | /index.php/fr/ | | warn: currentTest.recordFailure: Timed out after 30000ms info: Executing: |clickAndWait | css=li.item-175.first > a.subMenuBtn > span | | error: Element css=li.item-175.first > a.subMenuBtn > span not found warn: currentTest.recordFailure: Element css=li.item-175.first > a.subMenuBtn > span not found

When I read command line logs, Jenkins and commandline are different from firefox launch. On command line I can see a firefox poping, not with jenkins.

Without -debug, jenkins stops at "checking resource aliases".

I launched tomcat for jenkins as admin, still got my problem. Any ideas?

2
Did you configure your Jenkins server to run Selenium's test headless ? Take a look here - PierreF
Hi, thank you for your answer, but I'm on windows environment for benching the tool. Can't use X11 for now. - lordyoum

2 Answers

1
votes

From the paths being referenced, it looks like your Selenium server is in a Windows environment.

Since Selenium interacts with the desktop, make sure that the user account your Jenkins service is running under has the appropriate permissions to do that. (ie, run it as a named account and give that account access to the desktop via Computer Management / Services).

That would explain why you're seeing different behaviour running from the command line (as your user account) compared to in Jenkins (as the Jenkins service user account).

0
votes

You can try js-code to fix this error. JS-redirect. As:

storeEval window.location="http://yourWebsiteToOpen.com"; js echo ${js}

At least It helped for us.