2

セレンサーバーでコードセプションを使用してクロムでテストを実行すると、次のエラーがランダムに発生します。

WebDriver\Exception\UnknownError: The current platform is not supported: LINUX

WebDriver\Exception\UnknownError: Unable to find executable for product Opera Desktop

WebDriver\Exception\UnknownError: The path to the driver executable must be set by the phantomjs.binary.path capability/system property/PATH variable; for more information, see https://github.com/ariya/phantomjs/wiki. The latest version can be downloaded from http:\//phantomjs.org/download.html

firefox を指定すると、正常に動作します。

セレンを実行するためのコマンド:

java -jar selenium-server-standalone-2.31.0.jar -browser googlechrome

以下acceptance.yml内容です

class_name: WebGuy
modules:
  enabled:
    - Selenium2
    - WebHelper
  config:
    Selenium2:
      url: 'http://www.google.com'
      browser: googlechrome
  delay: 350
4

1 に答える 1

9

Chrome で codeception を実行するには、次を使用しますacceptance.suite.yml

class_name: WebGuy
modules:
  enabled:
    - Selenium2
    - WebHelper
  config:
    Selenium2:
      url: 'http://www.google.com'
      browser: chrome
      delay: 350

設定でブラウザを から に変更したことに注意してgooglechromeくださいchrome

また、次のコマンドを使用して Selenium2 を起動します。

java -Dwebdriver.chrome.driver=./chromedriver -jar selenium-server-standalone-2.31.0.jar

Selenium を起動するときにブラウザを指定する必要がないことに注意してください。

chromedriverはここからダウンロードできます。Selenium スタンドアロン サーバーも更新する必要があります。ここから最新バージョンを入手できます。

于 2013-08-13T09:01:10.093 に答える