I have written the selenium code in eclipse with the testng framework. My Java file looks like below one. But i don't know how can i run the below script parallely. I tried to configure the testng.xml to run the script parallely but its not working and no luch as well.

Do i need to integerate this script with the selenium grid to execute parallely? If yes please tell me in detail step by step.

import static org.testng.AssertJUnit.*;
import org.testng.annotations.*;
import com.thoughtworks.selenium.*;

public class Google {

private Selenium selenium;

@Parameters({"selenium.host","selenium.port","sele nium.browser","selenium.url"})
public void startSelenium(String host, String port, String browser, String url) {

this.selenium = new DefaultSelenium(host, Integer.parseInt(port), browser, url);

public void stopSelenium() {

public void googling(String search, String expected) {
try {
selenium.type("name=q", search);

} catch (SeleniumException e) {

and my testng.xml file looks like below,

<?xml version="1.0" encoding="UTF-8"?>

<suite name="TestSuite" parallel="tests" thread-count="5">
<parameter name="selenium.host" value="localhost"></parameter>
<parameter name="selenium.port" value="4444"></parameter>
<parameter name="selenium.browser" value="*firefox"></parameter>
<parameter name="selenium.url" value="http://www.google.com"></parameter>

<test name="Google">
<parameter name="search" value="Keep Coding"></parameter>
<parameter name="expected" value="keepcoding.blogspot.com"></parameter>
<class name="Google"></class>

Below are the things which i did,
1. Started the grid hub on 4444
2. launched two remote controls on different ports (5555,6666) and registered with the hub.
3. Executed the script in the eclipse IDE.
4. When i execute it it passes the command to hub and it forwards to the only one RC which is registered first with the hub. And its not executing it parallely.

Please guys help me on this as soon as possible. I am waiting for some good solution on this.

Thanks in Advance,