0

We have a setup where we have implemented our UI tests in Java using Selenium. The test runner is JUnit and we use maven for building. What we would like to achieve in our continuous integration is that we just use the (surefire) test goal of maven to run our UI tests on a Selenium Grid in a parallel way. So far I have found 2 problems that prevent us from doing this.

  1. I thought that we could somehow send all the tests to the Selenium Grid hub and it would take care of the parallelization but it seems that if I want to run 1000 tests on 20 nodes of the grid (each using 5 browsers) than I would actually need 100 threads on my Jenkins machine that executes the maven test goal. Is there any way to parallelize the tests without requiring the creation of the same amount of threads on the executor machine?

  2. The other problem we have (which this whole question is about) is that if I send 100 tests to the Selenium Grid and I realize that I messed up something about the tests and I stop the maven process that started the tests then the tests keep on executing in the Selenium Grid. Is there any way to cancel these tests? I found nothing in the Selenium API. (Not even in the undocumented REST API of the hub). Basically if I send some tests to the Grid, the only way to stop them is to kill the nodes (or the hub). Any workarounds for this?

Thanks in advance!

Zoli
  • 122
  • 7

1 Answers1

0
  1. You can use the "parallel" parameter in your testng.xml (Doc: http://testng.org/doc/documentation-main.html#parallel-running). After that you can easily set up every test by adding parameters to them (browserName, browserVersion, nodeName, etc...) and changing the capabilities of the RemoteWebDriver inside your program according to the parameters.

  2. I found this one, maybe it helps you: How to kill thread in a Selenium Grid node

Community
  • 1
  • 1
peetya
  • 3,158
  • 2
  • 13
  • 29