0

I'm using jenkins to run selenium standalone server and html test suites in a windows xp node. I've managed to get it running and working for iexplore and firefox, but when it comes to googlechrome it fails in starting it.

This is the command I use to run the tests in googlechrome:

java -jar C:\...\selenium-server-standalone-2.28.0.jar -htmlSuite "*googlechrome C:\Program Files\Google\Chrome\Application\chrome.exe --allow-file-access-from-files –-disable-web-security" file:///C:/WebTest/Tests/ C:/WebTest/Tests/TestSuite.html C:\jenkins\workspace\sp-webTest\resultados\resultadoGC.html 

And the error I get is:

12:43:08.044 INFO - Launching Google Chrome...
HTML suite exception seen:
java.lang.NullPointerException
    at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.createCommandArray(GoogleChromeLauncher.java:168)
    at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.launch(GoogleChromeLauncher.java:82)
    at org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchHTMLSuite(AbstractBrowserLauncher.java:47)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:145)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:196)
    at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:611)
    at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:285)
    at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:243)
    at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)

Any help will be appreciated.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Rombus
  • 341
  • 1
  • 7
  • 19
  • I also tried specifying the web driver, like this: `java -jar C:\..\selenium-server-standalone-2.28.0.jar -Dwebdriver.chrome.driver=C:\..\chromedriver.exe -htmlSuite "*googlechrome C:\Program Files\Google\Chrome\Application\chrome.exe --allow-file-access-from-files –-disable-web-security" "file:///C:/WebTest/Tests/" "C:/WebTest/Tests/TestSuite.html" "C:\jenkins\workspace\webTest\resultados\resultadoGC.html"` – Rombus Jan 17 '13 at 16:35

3 Answers3

0

Specifying the webdriver in java helps.

    System.setProperty("webdriver.chrome.driver", "c:/chromedriver.exe");
    driver = new ChromeDriver();

Download link for chrome driver http://code.google.com/p/chromedriver/downloads/list

  • Thanks for answering, how do I do that? I'm using the standalone running html suites – Rombus Jan 18 '13 at 12:00
  • You can do it with eclipse IDE [link](http://www.eclipse.org/downloads/) you have to manually write the test case and then execute the code eg: http://pastebin.com/Yh3ucrkT – Parth Kambli Jan 18 '13 at 12:11
  • I figure out how to get chrome running. I removed the parameters to chrome.exe and replace the startUrl from "file///...." to "http:/.." and it works. I also added chrome to the PATH. Anyways, I need to run with local files, not with http:/ files. `java -jar C:\instalados\WebTesting\selenium-server-standalone-2.28.0.jar -trustAllSSLCertificates -htmlSuite *googlechrome http://../htmlTestSuites/ C:\WebTest\TestSuite_RepViajeCan.html C:/jenkins/workspace/webTest/resultados/resultadoGC.html` – Rombus Jan 18 '13 at 13:51
0

I got it working, somehow sending flags to chrome in the command causes selenium to throw null pointer exception. So what I did was add chrome to the PATH in mi xp node, use Selenium plugin to run html test suites in jenkins and specify a start url that begins with "https://" using google chrome and a start url that begins with "file:///" was a mess and couldn't get it to work like that. I also added the -trustAllSSLCertificates in "others" input box.

Rombus
  • 341
  • 1
  • 7
  • 19
0

For me on Windows it work:

java -jar "c:\selenium-server-standalone-2.35.0.jar" -forcedBrowserMode "*googlechrome c:\Program Files\Google\Chrome\Application\chrome.exe" 
Evgeniy Tkachenko
  • 1,733
  • 1
  • 17
  • 23