0

私は使用します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

私はその理由を見つけようとしますが、成功しません。何か助けはありますか?

4

1 に答える 1

0

これを試してください:

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

うまくいかない場合は、新しい機能 (サファリパス) を設定する必要があるかもしれません:

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

それは私にとってはうまくいきます。

于 2013-08-26T07:06:20.057 に答える