I am trying to run the code below in selenium GRID (executing the "local" code, works correctly), follows code snippet:

```
SuiteTest.xml:

```

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="SuiteTest" verbose="1" thread-count="2" parallel="tests"> 
        <test name="FIREFOX Test">
        <parameter name="browser" value="FIREFOX" />
        <classes>
            <class name="test.CN01_CT01_IncluirConteudoMP3" />
            <class name="test.CN01_CT02_IncluirConteudoMP4" />
        </classes>
    </test>

        <test name="CHROME Test">
        <parameter name="browser" value="CHROME" />
        <classes>
            <class name="test.CN01_CT01_IncluirConteudoMP3" />
            <class name="test.CN01_CT02_IncluirConteudoMP4" />
        </classes>
    </test>         
</suite>

```

BaseTest:

```java
public class BaseTest {

    protected static ExtentReports extent;
    public static String testName;

    @Parameters({ "browser" })
    @BeforeMethod
    public void BeforeTest(Method method, Browsers browser) throws IOException, BiffException {

        Propriedades.browser = browser;
        String browserStr = browser.toString();         
        System.out.println("Before ........" + method.getName());       
        //Recuperar nome do Teste
        testName = method.getName() + "-" + browserStr;     
        // Realizando Login
        LoginPage.realizarLogin();    
        //Iniciar o relatorio
        extent = ExtentReport.StartReport(testName);

    }

    @AfterMethod
    public void finaliza(ITestResult result) throws IOException {
        System.out.println("After ........");

        //Validar Resultado dos Testes
        ExtentReport.ResultTest(result, testName);

        // Realizar Logout
        LoginPage.realizarLogout();

        // Fechando Browser
        if (Propriedades.FECHAR_BROWSER) {
            killDriver();
        }
    }

    @AfterSuite
    public static void finalizaTudo(){
        DriverFactory.killDriver();
        extent.flush();
        System.out.println("AfterSuite........");
        System.out.println(ExtentReport.diretorioReport);
        //DriverFactory.executeChrome(ExtentReport.diretorioReport);
    }

}

```

BasePage:

```java
public class BasePage {

    protected static DSL dsl;

    static List<String> result = Ambiente.dadosAmbiente();
    static String url = result.get(0);
    protected static String user = result.get(1);
    protected static String pass = result.get(2);

    public BasePage() {
        dsl = new DSL();
    }

}

```

DSL:

```java
public class DSL {

    public void clicarRadio(By by) {
        getDriver().findElement(by).click();
    }   

Other methods to access the screen elements (Text, Click, Button, Radio, Combo and etc.)

(...)

}

```

DriveFactory:

```java
public class DriverFactory {

    static WebDriver driver;

    private DriverFactory() {
    }

    public static WebDriver getDriver() {           

        if(Propriedades.tipoExecucao == TipoExecucao.LOCAL){

                if (driver == null) {
                    switch (Propriedades.browser) {
                    case CHROME:
                        executeChrome(BasePage.url);
                        break;
                    case FIREFOX:
                        executeFirefox(BasePage.url);
                        break;
                    case IE:
                        executeIE(BasePage.url);
                        break;
                    case EDGE:
                        executeEgde(BasePage.url);
                        break;
                    }
                    driver.manage().window().maximize();
                }
        }

        if(Propriedades.tipoExecucao == TipoExecucao.GRID) {

            DesiredCapabilities cap = null;
                switch (Propriedades.browser) {
                case CHROME:
                    cap = DesiredCapabilities.chrome();
                    break;
                case FIREFOX:
                    cap = DesiredCapabilities.firefox();
                    break;
                case IE:
                    cap = DesiredCapabilities.internetExplorer();
                    break;
                case EDGE:
                    cap = DesiredCapabilities.edge();
                    break;
                }

                try {
                    driver = new RemoteWebDriver(new URL("http://192.168.0.72:4444/wd/hub"), cap);
                } catch (MalformedURLException e) {
                    System.err.println("Falha ao conectar ao GRID");
                }
                driver.manage().window().maximize();
                driver.get(BasePage.url);
                System.out.println("Abriu Browser Grid");
    }

        return driver;
}

    public static void killDriver() {
        if (driver != null) {
            driver.close();
            driver.quit();          
            driver = null;
        }
    }
}

```

Test - Class:

Test classes, just to check that execution is logging in and logout.

```java
@Test
public void CN01_CT02_IncluirConteudoMp4(){

assertEquals("123", "123");
}

@Test

public void CN01_CT01_IncluirConteudoMp3() throws InterruptedException, AWTException{

assertEquals("123", "123456");
}

```

Configuration Grid

Config (Json) - Hub:

```
{
  "port": 4444,
  "newSessionWaitTimeout": -1,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {},
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "registry": "org.openqa.grid.internal.DefaultGridRegistry",
  "throwOnCapabilityNotPresent": true,
  "cleanUpCycle": 5000,
  "role": "hub",
  "debug": false,
  "browserTimeout": 0,
  "timeout": 1800
}

```

NodeChrome:

```
{
    "capabilities": [
        {
            "browserName": "chrome",
            "maxInstances": 1,
            "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
        }
    ],
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "maxSession": 1,
    "port": 5555,
    "register": true,
    "registerCycle": 5000,
    "hub": "http://192.168.0.72:4444",
    "nodeStatusCheckTimeout": 5000,
    "nodePolling": 5000,
    "role": "node",
    "unregisterIfStillDownAfter": 60000,
    "downPollingLimit": 1,
    "debug": false,
    "servlets": [
    ],
    "withoutServlets": [

    ],
    "custom": {
    }
}

```

NodeFirefox:

```
{
    "capabilities": [
        {
            "browserName": "firefox",
            "maxInstances": 1,
            "webdriver.gecko.driver": "C:/Program Files/Mozilla Firefox/firefox.exe"
        }
    ],
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "maxSession": 1,
    "port": 5556,
    "register": true,
    "registerCycle": 5000,
    "hub": "http://192.168.0.72:4444",
    "nodeStatusCheckTimeout": 5000,
    "nodePolling": 5000,
    "role": "node",
    "unregisterIfStillDownAfter": 60000,
    "downPollingLimit": 1,
    "debug": false,
    "servlets": [

    ],
    "withoutServlets": [

    ],
    "custom": {
    }
}

```

When executing the code using Selenium GRID, the system opens two browsers but does not log in, problem occurs (apparently sync problem).

Example:

The login field is filled in "twice" and "Invalid Login" is returned.

Code is executed using the Eclipse IDE.
Run (SuiteTest.xml) - Run with TestNG