我是新來硒網絡驅動器以及柵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");
}
}