Below is the details where I have got exceptions as below :
When I start the node by using the below command it gives me the error like below :
F:\SeleniumGrid\Jars>java -jar selenium-server-standalone-3.0.0-beta2.jar -role webdriver -hub http://HubIpAddress:4444/grid/register -browser browserName=”firefox”, version=ANY, platform=VISTA, maxInstances=5 -Dwebdriver.gecko.driver.exe
Exception in thread “main” com.beust.jcommander.ParameterException: Was passed main parameter ‘version=ANY,’ but no main parameter was defined at com.beust.jcommander.JCommander.getMainParameter(JCommander.java:914) at com.beust.jcommander.JCommander.parseValues(JCommander.java:759) at com.beust.jcommander.JCommander.parse(JCommander.java:282) at com.beust.jcommander.JCommander.parse(JCommander.java:265) at com.beust.jcommander.JCommander.(JCommander.java:210) at org.openqa.grid.selenium.GridLauncherV3$3.setConfiguration(GridLauncherV3.java:231) at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:130) at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:67)
Please let me know if am done anything wrong in the above command.
Below is the java code used:
package com.test.grid;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class SelGrid {
WebDriver driver;
String baseUrl, nodeURL, hubURL;
@BeforeTest
public void setUp() throws MalformedURLException {
baseUrl = "https://www.google.co.in/";
hubURL = "http://HubIpAddress:4444/wd/hub";
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName("firefox");
capability.setPlatform(Platform.VISTA);
driver = new RemoteWebDriver (new URL(hubURL), capability);
}
@AfterTest
public void afterTest()
{
driver.quit();
}
@Test
public void simpleTest()
{
driver.get(baseUrl);
Assert.assertEquals("Welcome: Mercury Tours", driver.getTitle());
}
}