Is it possible to know which node the selenium grid hub assigned to your test? My tests need to talk to other services on the node machine in order to perform configurations which are not supported by selenium.
Mark
But Selenium Grid can have any number of nodes. So you can have 200 nodes, and that means you have 200 driver.exe's and 200 browser windows running all at once.
To double-check if the hub is up and running, you can simply type in http://localhost:4444/grid/console in your web browser of choice. Clicking on the View Config link pulls up a detailed configuration window with data that we succeeded in launching a Selenium hub.
RemoteWebDriver is used to set which node (or machine) that our test will run against.
A Selenium Grid has only one Hub and it is launched on a single machine once. Node − Nodes are the Selenium instances that are attached to the Hub which execute the tests. There can be one or more nodes in a grid which can be of any OS and can contain any of the Selenium supported browsers.
Generally you shouldn't rely on knowing what machine your test is running on. Grid 2 provides a series of callback listeners that you could implement to provide machine configuration. But, if you really want to see what node a test is running on, you could use one of the API calls. Both endpoints can be found on the hub:
http://localhost:4444/grid/api/proxy
http://localhost:4444/grid/api/testsession
Neither are documented yet. But if you view the source, it's straightforward to see how they work. You want to look at the ProxyStatusServlet and TestSessionStatusServlet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With