下面就是我有例外情況如下細節:如何設置硒電網與硒3
當我通過使用下面的命令來啓動該節點它給我的錯誤象下面這樣:
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
線程「main」中的異常com.beust.jcommander.ParameterException:傳遞了主參數'version = ANY',但沒有主參數 被定義爲 at com.beust.jcommander.JCommander.getMainParameter(JCommander.java:914 ) at com.beust.jcommander.JCommander.parseValues(JCommander.java:75 9) 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) 在org.openqa.grid.selenium.GridLauncherV3 $ 3.setConfiguration(GridLauncherV3.java:231) 在org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:130) 的組織。 openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:67)
請讓我知道如果我在上述命令中做了任何錯誤。
下面是使用Java代碼:
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());
}
}
這個問題的整體思路是硒3合作在那裏將使用geckodriver並使其與Selenium網格兼容,解決與此問題相關的問題t是受歡迎的。 – Bharadwaj