質問

I get the following errors in random when running test on chrome using codeception in selenium server:

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

When given firefox, it works fine.

command for running selenium:

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

Following is the acceptance.yml content

class_name: WebGuy
modules:
  enabled:
    - Selenium2
    - WebHelper
  config:
    Selenium2:
      url: 'http://www.google.com'
      browser: googlechrome
  delay: 350
役に立ちましたか?

解決

To run codeception with Chrome, use the following acceptance.suite.yml:

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

Note that i changed your browser in the config from googlechrome to chrome.

Also, start Selenium2 by using this command:

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

Note that you don't need to specify the browser when starting selenium.

You can download chromedriver here. You should also update your selenium standalone server; you can get the latest version from here.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top