使用网格和Safari的Webdriver / Exception:转发新会话时出错

时间:2013-08-25 14:15:47

标签: macos selenium webdriver

我使用selenium-server-srandalone-2.35.0.jar

在服务器端,我运行下一个命令:java -jar selenium-server-standalone-2.35.0.jar -role hub -port 4951

并使用下一个配置:

DesiredCapabilities capability = DesiredCapabilities.safari();
capability.setBrowserName("safari");
capability.setPlatform(org.openqa.selenium.Platform.MAC);
WebDriver webdriver = new RemoteWebDriver(new URL("http://localhost:4951/wd/hub"), capability);

在MAC计算机中,我运行下一个命令:java -jar selenium-server-standalone-2.35.0.jar -role node -hub http://myIP:4951/grid/register

当我尝试连接时(在新的RemoteWebDriver中......),它给了我下一个选择:

org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : {platform=MAC, browserName=safari, version=}
Command duration or timeout: 720 milliseconds

我试图找到原因,但没有成功。有什么帮助吗?

1 个答案:

答案 0 :(得分:0)

请试试这个:

java -jar selenium-server-standalone-2.35.0.jar -role wd -hub http://myIP:4951/grid/register -browser browserName=safari,platform=MAC

如果它不起作用,可能你必须设置一个新的功能(safari路径):

capability.setCapability(SafariDriver.DATA_DIR_CAPABILITY,
         "/Users/<your_user>/Library/Safari");

这适合我。