I obtain a RemoteWebDriver from the hub as follows:
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://whatever:4444/wd/hub"),
DesiredCapabilities.internetExplorer() );
Is there a way to programatically find out which node in the grid the remote driver is running on?
I want to log this in an effort to track down intermittent test failures.
Please refer to this blog post of mine to learn how to find out the node ip and port to which the test was routed to.
Blog post : https://rationaleemotions.wordpress.com/2016/01/15/where-did-my-test-run/
In a nutshell, here's what you need to do (The blog I shared has elaborate explanation and required code )
localhost with the actual Grid IP/host and replace 4444 with the port on which grid is listening to) and trigger a POST call.proxyId as a URL and extract out the IP and port from it.This is now available for ready consumption via the library talk2grid that I built.
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