Is there a way to execute a batch file that lives on a remote Node machine using Selenium Grid to change the hosts file?
VM1 contains the code and acts as the Hub VM2 runs a Chrome Node VM3 runs a Firefox Node VM4 runs an IE Node
A set of batch files exist on each VM, however, running as is, only VM1 is getting the batch file executed. How do I tell the Selenium to execute the batch file on the correct Node?
FWIW, I am now executing the jobs via Jenkins.
When I originally wrote the code, I was only running the tests locally via Eclipse and not using the Grid. That being said, I wrote an AutoIT script to handle the task. The code I'm using that works when running locally is:
String env = StoredVariables.getenvironment().get();
if (env.equals("Beta Offline"))
{
env = "BetaOffline";
}
if (env.equals("Live Offline"))
{
env = "LiveOffline";
}
System.out.println("Set hosts file to " + env + " via AutoIT");
Thread.sleep(3000);
Runtime.getRuntime().exec(StoredVariables.getautoIT().get()+"HostsSwitcher.exe " + StoredVariables.getautoIT().get() + " " + env);