title: How to set up Grid 2 in selenium RC using through Java-TestNG
body: <p>I am new to Grid and am trying to set up Grid 2 in Selenium RC.</p>
  
  <p>I have downloaded the selenium-server-standalone-2.1.0.jar. Also I have my TestNG test cases.</p>
  
  <p>And I have a test XML like:</p>
  
  <pre><code>&lt;suite thread-count="1" name="Suite" parallel="tests" verbose="10"&gt;&lt;!-- tests --&gt;
          &lt;test name="FFTest" preserve-order="true"&gt;
          &lt;parameter name="selenium.host" value="localhost"&gt;&lt;/parameter&gt;
          &lt;parameter name="selenium.port" value="5569"&gt;&lt;/parameter&gt;
          &lt;parameter name="selenium.browser" value="*firefox"&gt;&lt;/parameter&gt;
          &lt;parameter name="selenium.url" value="http://www.google.com"&gt;&lt;/parameter&gt;
          &lt;classes&gt;
  
              &lt;class name="EmployeeHealth.TestScripts.EmployeeHealthRegressionSuite"&gt;
                  &lt;methods&gt;
                      &lt;include name="InitScript"&gt;&lt;/include&gt; 
                      &lt;include name="SelectAvoidableAdmissionModule"&gt;&lt;/include&gt;
                      &lt;/methods&gt;  
              &lt;/class&gt;
  
  
          &lt;/classes&gt;
      &lt;/test&gt;
  &lt;test name="IETest" preserve-order="true"&gt;
      &lt;parameter name="selenium.host" value="localhost"&gt;&lt;/parameter&gt;
      &lt;parameter name="selenium.port" value="5579"&gt;&lt;/parameter&gt;
      &lt;parameter name="selenium.browser" value="*iehta"&gt;&lt;/parameter&gt;
      &lt;parameter name="selenium.url" value="http://www.google.com"&gt;&lt;/parameter&gt;
      &lt;classes&gt;
  
          &lt;class name="EmployeeHealth.TestScripts.EmployeeHealthRegressionSuite"&gt;
              &lt;methods&gt;
                  &lt;include name="InitScript"&gt;&lt;/include&gt; 
                  &lt;include name="SelectAvoidableAdmissionModule"&gt;&lt;/include&gt;
                  &lt;/methods&gt;  
          &lt;/class&gt;
  
  
      &lt;/classes&gt;
  &lt;/test&gt;
  &lt;/suite&gt;    
  </code></pre>
  
  <p>And I followed the below steps:</p>
  
  <p>Start Hub:</p>
  
  <pre><code>        java -jar selenium-server-standalone-2.5.0.jar -role hub
  </code></pre>
  
  <p>Start remote control supporting Firefox </p>
  
  <pre><code>        java -jar selenium-server-standalone-2.5.0.jar -role RC -hub http://localhost:4444/grid/register -browser browserName=firefox,platform=WINDOWS -port 5579
  </code></pre>
  
  <p>Start another RC supporting Internet explore </p>
  
  <pre><code>        java -jar selenium-server-standalone-2.5.0.jar -role RC -hub http://localhost:4444/grid/register -browser browserName=iexplore,platform=WINDOWS -port 5556.
  </code></pre>
  
  <p>And in my SetUp.java file, Am creating the selenium objects like:</p>
  
  <pre><code>        selenium =  new DefaultSelenium(host,Integer.parseInt(port),
                          browser, url);
  
  
                  if ( browser.equalsIgnoreCase("*chrome")) {
                      RemoteControlConfiguration rcc = new RemoteControlConfiguration();
                      rcc.setFirefoxProfileTemplate(new File(
                              "test\\Resources\\ThirdParty\\FirefoxProfile\\"));
                      seleniumServer = new SeleniumServer(rcc);
  
                  } else {
                      RemoteControlConfiguration rcc = new RemoteControlConfiguration();
                      rcc.setFirefoxProfileTemplate(new File("Object Repository\\SSL"));
                              //"src\\Script\\lib\\ThirdParty\\FirefoxProfile\\"));C:\\Biju\\NewFrameworkStrcuture\\Framework\\ABC_JSAF\\
  
                      seleniumServer = new SeleniumServer(rcc);
                      RemoteControlConfiguration a= seleniumServer.getConfiguration();
                      File uimap=new File("src\\Script\\lib\\user-extensions.js");
                      a.setUserExtensions(uimap);
                      //seleniumServer = new SeleniumServer();
                  }
                  //seleniumServer.start();
                  selenium.start();
                  selenium.windowMaximize();
                  selenium.windowFocus();
  </code></pre>
  
  <p>By this way, when am running the xml file, the tests are running in sequence(First Firefox and then the IE). But not in parallel.</p>
  
  <p>Also i tried giving the @Test parameter like </p>
  
  <pre><code>  @Test(dataProvider="CommonTestData",threadPoolSize = 3)
  </code></pre>
  
  <p>But i dont see any change in the seqence.</p>
  
  <p>do any one got why this is happening?..</p>
  
  <p>Appreciate for your help.</p>
  
  <hr>
  
  <p>A J, Thanks for the reply.</p>
  
  <p>I did changes in the XML suite and I made the dataprovider function as "parallel=true" and also added the Invokation function @Test parameter "InvoationCount=2",and configure the node  and am able to launch 1 IE and 1 FF parallel.</p>
  
  <p>But now the problem is, in one browser(Say IE), my test cases are executing perfectly.But in the other browser(FF) ,after launching the browser, I don't see any other action performing on it.Not even opening my URL. in the console I got error : 
     "FAILED CONFIGURATION: @BeforeClass Seleniumstart
          ("localhost", "5569", "*firefox", "<a href="http://www.google.com" rel="nofollow">http://www.google.com</a>")
      com.thoughtworks.selenium.SeleniumException: ERROR Server Exception: sessionId should not be<br>
       null; has this session been started yet?" 
  Any idea on this?..</p>