0

Am executing Selenium test cases from Jenkins locally but execution is happening in back-end am not able to see the browser launch and close.

Is it possible to see the execution when I trigger from Jenkins without help of selenium grid on single machine with Windows platform?

1

Jenkins is a Continuous Integration which integrate with Selenium and let you run tests on server every time a build is ready. The main purpose here is to go headless, so that nothing will be on viewport and selenium code will be executed behind the scene. To perform this, jenkins use xvfb or X virtual framebuffer for unix based machine which is a in memory display server, where the selenium actually play. For windows it has counter methods.

I am not sure, whether jenkins will allow you to actually run the tests in your view port or not. However, there is an interesting post I find which sets up a windows machine and uses IE to hosts the selenium test cases. I hope this can help. https://gist.github.com/stenver/337aea741fe7d70ce703

1

Yes, it is possible. Easiest way is to run selenium server on your desktop. You will need to enable connections to your desktop (just on one port to be safe, 4444 by default), and configure selenium to use your desktop and desired browser - simple batch command is all you need.

You don't need grid for that, just selenium-server.jar running on your desktop, listening for connections. Configure your selenium test to connect to your desktop. This is the easiest way, that's how I started with Selenium :-)

  • 1.i launched selenium Hub using selenium standalone server on port 4444 2.i used below code to run locally System.setProperty("webdriver.firefox.marionette", "C:\\Resource\\geckodriver.exe"); driver = new FirefoxDriver(); driver.manage().window().maximize(); 3.then triggered from Jenkins but browser is nt launching. – user6050545 Mar 30 '17 at 8:36
0

If you are running Jenkins as a service then you won't be able to invoke the browsers.

But if you run the Jenkins jar from the command line, then you'll be able to invoke your real browsers.

0

If you are running Jenkins as a service then you won't be able to invoke the browsers.
(So you have to stop Jenkins service).

But if you run the Jenkins jar from the command line, then you'll be able to invoke your real browsers. open the command prompt and execute the command.

java -jar {directoryOfJenkinsFile}/jenkins.war

It will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.