相关疑难解决方法(0)

WebDriverException:转发新会话时出错无法找到:{platform = WINDOWS,browserName = FIREFOX,version = 3.6}

我是Selenium Web驱动程序以及Grid 2的新手.

我试图运行测试用例,但它给了我一个例外

线程"main"中的异常org.openqa.selenium.WebDriverException:转发新会话时出错:找不到:{platform = WINDOWS,browserName = FIREFOX,version = 3.6}

我已经使用命令启动了一个节点和集线器

java -jar selenium-server-standalone-2.29.0.jar -role hub

java -jar selenium-server-standalone-2.29.0.jar -role node  -hub %grid register%
Run Code Online (Sandbox Code Playgroud)

这两个命令都运行正常.

我不确定我何时何地需要使用命令行-browser browserName = firefox,version = 3.6,maxInstances = 5,platform = WINDOWS

(试图从Grid 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); …
Run Code Online (Sandbox Code Playgroud)

java selenium-webdriver

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

java ×1

selenium-webdriver ×1