Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium GRID vs TestNG parallel

This topic is the beginning of the answer I am looking for. I need to know more.

Short story:

Why use GRID if pure TestNG parallel execution seems to work just fine?

Long story:

Background:

  • We are running about 40 tests now, growing.
  • We only use one browser (chrome).
  • To make tests faster we do parallel testing (makes sense).
  • We face issues configuring GRID solution,
  • in many cases we just drop it and run pure testNG parallel.

Question:

  1. I need to know if it even makes sense to be so stubborn on that whole GRID. For now it only seems to consume time without giving any additional value.

My own thoughts: The only thing i can think of to justify GRID is running the tests using different machines. If we would need to actually balance the load on several servers. But at this point even my own laptop is doing the job just perfectly. This situation will not change dramatically in nearest future, so why bother? The link mentioned above claims the results of the no-grid parallel tests may become unpredictable. We do not face that. So the question may be: in what sense unpredictable? What to watch out for?

Thanks in advance for your help.

cheers, Greg

like image 306
Greg B Avatar asked Nov 16 '25 22:11

Greg B


2 Answers

The Grid mimics as a load balancer and distribute tests to nodes according to the desired capabilities. While the parallel attribute in testNG xml is just instructing the testNGrunner to trigger n number of tests at one go.

CAVEAT : If you do not use grid for parallel test execution, your single host will get overloaded as you scale up the thread-count. The results of the no-grid parallel tests may become unpredictable because multiple sessions will fill up the heap memory quickly. A general purpose computer has limited Heap memory . You are not facing this issue ,may be because you did not hit that limit.

like image 78
Manmohan_singh Avatar answered Nov 19 '25 13:11

Manmohan_singh


Lets consider some examples:

  1. Your target is to check functionality on windows as well as on MAC. Without grid you will run the cases twice.

  2. You got a test case where a functionality breaks at older version of a browser and now its time for regression test. Without grid you will be running test cases multiple times for each browser's older version.

  3. A case that is dependent on different screen resolutions.

Grid can simplify the effort for configuration.

Its just about making the time as much minimal as possible for running number of test cases.

like image 30
Rabia Asif Avatar answered Nov 19 '25 14:11

Rabia Asif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!