How do I limit simultaneous Selenium browsers being run by Jenkins?

0

I have a Jenkins project that runs more than a hundred Cucumber feature files. Each test scenario uses Selenium because I need to test the UI of my website. The problem is that Jenkins try to run them almost all at once hence I get an explosion of Selenium Google Chrome browsers trying to pop up all at once. This leads to my machine running out of memory and only a few Selenium browsers being responsive.

Is there a way for me to limit the amount of Selenium browsers being active at one time? It could be on Jenkins or in Selenium but I'd rather stay away from Selenium Grid.

Batibot323

Posted 2019-05-16T13:10:45.483

Reputation: 13

Answers

0

Have you tried using a framework? I use TestNG, and there is an option in the XML you can build to run your tests that lets you throttle the number of threads used by the tests.

I run my tests against SauceLabs, so I have to throttle to the number of concurrent sessions to what I'm allowed to use.

If you want a strict Jenkins solution, I'm seeing a bunch of references to plugins that help to throttle your tests at a branch level.

Dan Pearman

Posted 2019-05-16T13:10:45.483

Reputation: 1