Search code examples
javaseleniumselenium-grid

Selenium Hub Pause Data Stream


I'm looking for a way to pause the data stream of a selenium hub. The idea is to wait till the hub has finished processing a test/batch, put it on hold, send a kill command to node, on headless VM to restart, upon reconnect allow data stream to continue. The idea is to allow the nodes/vm's to restart and refresh, potentially avoiding hangups and connection timeouts. Thoughts?


Solution

  • Instead of pausing the data stream, you can create a java class that implements TestSessionListener. This interface has the methods which can tell you when a test is starting and ending. You can write your custom code to restart the machines after each test or based on some other logic.

    You can refer to Selenium Grid Extras project which uses this. For a much more simple example on creating a grid plugin refer the Grid Plugin Tutorial