【问题标题】:Codeception - how to run acceptance tests in chromeCodeception - 如何在 chrome 中运行验收测试
【发布时间】:2015-10-21 00:34:50
【问题描述】:

谁能帮我在 chrome 中运行验收测试

1)我的acceptance.suite.yml文件结构是

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
                url: http://localhost:81/project
                browser: 'chrome'
                window_size: 1024x768
                wait: 10
        - \Helper\Acceptance

2)我将 selenium-server-standalone-2.47.1.jar 和 chromedriver.exe 保存在同一个文件夹中。

我尝试使用命令 java -jar selenium-server-standalone-2.47.1.jar -Dwebdriver.chrome.driver=C:\stuff\sel\codeceptiontest\chromedriver.exe 启动我的 selenium 服务器

3)我收到一个错误"Error: Could not find or load main class ="

4)这是运行我的文件的正确命令吗?
php codecept.phar run tests/acceptance/loginCept.php --env chrome

【问题讨论】:

  • 所以你的问题是你不能启动 selenium,对吧?
  • 是的。我无法启动硒。我收到了上面指定的错误。我在接受 yml 中的设置是否正确?
  • 你能用Winzip打开jar吗?它可能已损坏!

标签: google-chrome selenium codeception


【解决方案1】:

您可以分别运行 Chrome Web Driver 和 Selenium Server。它们工作得很好。

【讨论】:

    【解决方案2】:
    1. 先安装chrome驱动,这样运行

    java -jar selenium-server-standalone-2.52.0.jar -Dwebdriver.chrome.driver=/Users/ravis/Downloads/chromedriver

    1. 在 yml 文件中:

    class_name: AcceptanceTester 模块: 启用: - 网络驱动程序: 网址:http://google.com 浏览器:火狐 - \Helper\Acceptance

    环境: 铬合金: 模块: 配置: 网络驱动程序: 浏览器:“铬”

    它将覆盖 Firefox 并为 chrome 设置环境。如果你愿意,你可以试试。

    1. 运行 cmd: codecept 运行接受 Loginfile --env chrome

    希望它对你有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-01
      • 2016-11-03
      • 1970-01-01
      • 1970-01-01
      • 2016-06-02
      • 1970-01-01
      • 1970-01-01
      • 2015-06-21
      相关资源
      最近更新 更多