I am using RemoteWebDriver from Selenium 2 and Grid to divide my tests on several virtual machines. Let's say I have two Linux machines and in a test I specify the capabilities to run on a Linux machine, I can't figure out which of these two machines is being used. Is there any way, to figure it out? Something like driver.getServerIp() or anything else? The reason is, in my Selenium test code I want to start a bash script on the console of the linux machine where the test is being run. Therefore I have to know on which machine the test runs.
Thanks guys!
Although presumably you'd know the address since you passed it into the constructor for RemoteWebDriver anyway.
My java skills aren't the greatest and this code could use some cleaning up, but this works for me.
proxyID contains the IP of the node.
Answer provided by Bobble D is working only that there was problem with JSONParser as mentioned by Nilesh as well, here is updated code which can help