0

I have been running Selenium test cases successfully on my local Jenkins. When I run test cases on my local jenkins it opens up chrome/safari or any specified browser on my machine to run. Now I would like to run the same job on my company Jenkins. But Jenkins is not set up on real machine. So it does not have browser. How do I run my suite on company Jenkins. I do not want to run headless.

Thanks

user2113098
  • 131
  • 1
  • 2
  • 10

2 Answers2

0

You need to run selenium grid on your server machine, where jenkins is installed. After that you need to run a register script to your grid in the machine where you will run browsers. Before run the browser, get some files ready in a folder. Selenium-server and the browser driver (chromedriver, iedriver whichever you want to use. You don't need firefox)

Script should be like this

cd /path/path/selenium 
java -jar selenium-server-standalone-2.46.0.jar -role node  -hub http://your.ip.address:4444/grid/register -browser "browserName=firefox,maxInstances=10,platform=MAC" -browser "browserName=chrome,maxInstances=10,platform=MAC" -maxSession 20 -Dwebdriver.chrome.driver=/path/path/selenium/chromedriver

You can edit the script according to your system (MAC/Windows, file paths. file names)

Taylan Derinbay
  • 128
  • 3
  • 13
0
  • Install the required browsers on Company Jenkins:

It may be the good and effective option, but in case it can't be done refer other options.

These browsers are good for testing simple features but not meant for advanced feature testing. Headless browsers are not equivalent to real browsers.

You can distribute your tests over different nodes and run tests parallel as well using the Grid. Make your Jenkins machine the Hub and add different Nodes to run your tests, Refer this.

Virtual machine can help you save the Hardware cost by creating virtual servers for running your tests. This can also be done in conjunction with Selenium Grid. Refer this.

Best is to use cloud for running your tests. You need not worry about the testing environment like browsers and platforms as they have almost every possible browser + platform combination to run your test.

Community
  • 1
  • 1
Manu
  • 2,251
  • 19
  • 30
  • 1
    This is Mukul from BrowserStack. We have recently released a [Jenkins Plugin](https://wiki.jenkins-ci.org/display/JENKINS/BrowserStack+Plugin) that makes integrating your Jenkins CI with BrowserStack even easier. Hope this helps! – mukulg Jul 19 '16 at 11:29