我是新来硒网络驱动器以及栅2WebDriverException:错误转发新的会话找不到:{平台= WINDOWS,browserName = FIREFOX,版本= 3.6}
我试图运行测试如此,但它给了我主要的例外 “在线程异常‘’org.openqa.selenium.WebDriverException:错误转发新的会话找不到:{平台= WINDOWS,browserName = FIREFOX,版本= 3.6}”
我使用命令启动了一个节点和集线器 java -jar selenium-server-standalone-2.29.0.jar -role集线器
java -jar selenium-server-standalone-2.29.0.jar -role node -hub%grid register%
这两个命令都正常工作。
我不知道何时何地,我需要使用命令行 -browser browserName =火狐,版本= 3.6,MAXINSTANCES = 5,平台= WINDOWS
(试图从电网配置节点2官方
页是不是因为任何帮助,这将是非常赞赏
这里是我的代码:?
package test;
import java.net.URL;
import java.net.MalformedURLException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Test {
public static void main(String[] args) throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName("FIREFOX");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
capability.setVersion("3.6");
// capability.setCapability("");
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
//WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
}
}