selenium-webdriver Java code for Selenium Grid


Example

String hubUrl = "http://localhost:4444/wd/hub"       
DesiredCapabilities capability = DesiredCapabilities.firefox(); //or which browser you want
RemoteWebDriver driver = new RemoteWebDriver(hubUrl, capability);