title: Selenium using Java: Start Hub Server and register Nodes with Hub
body: <p>I am new to the selenium and I have been trying to start Selenium Hub and adding the node to the Hub using java. I have started it using command prompt but I want it to happen on its own. I am able to start the Hub but have no Idea how to add the Node. </p>
  
  <p>Following is my code to start the Hub:</p>
  
  <pre><code>import org.openqa.grid.internal.utils.configuration.GridHubConfiguration;
  import org.openqa.grid.internal.utils.configuration.GridNodeConfiguration;
  import org.openqa.grid.web.Hub;
  
  public class StartHub {
  
      public static void main(String[] args) throws Exception {
          // TODO Auto-generated method stub
          GridHubConfiguration configHub = new GridHubConfiguration();
          configHub.host = "localhost";
          configHub.port = 8060;
  
          //GridNodeConfiguration configNode = new GridNodeConfiguration();
          //configNode.host = configHub.host;
          //configNode.port = 5300;
  
          Hub hub = new Hub(configHub);
          //configNode.getHubHost();
          hub.start();
  
          //System.out.println(configNode.getRemoteHost());
  
          //hub.stop();
      }
  
  }
  </code></pre>
  
  <p>How to add a Node going forward ?</p>