从 Windows 7 运行 Codeception 时出现 Web 驱动程序错误

Web driver error when running Codeception from Windows 7

提问人:AnOldSoul 提问时间:7/20/2017 最后编辑:AnOldSoul 更新时间:7/20/2017 访问量:588

问:

我正在 Windows 7 机器上运行我的 codeception 验收测试,这导致了下面提到的问题。

Signature: somethingSearchCept
Test: tests\acceptance\test\tstCases_somethingSearch\somethingSearchCept.php
Scenario --
  WebDriver::debugWebDriverLogs method has been called when webDriver is not set

  WebDriver::_saveScreenshot method has been called when webDriver is not set
  WebDriver::_savePageSource method has been called when webDriver is not set
  Screenshot and page source were saved into 'D:\Training\codeception\tests/_out
put\' dir
 ERROR

  /
 Codeception\Test\Cept: test
   I am on page "/"
  [GET] https://www.google.com/
PHP Fatal error:  Call to a member function get() on null in phar://D:/Training/
codeception/codecept.phar/src/Codeception/Module/WebDriver.php on line 729

Fatal error: Call to a member function get() on null in phar://D:/Training/codec
eption/codecept.phar/src/Codeception/Module/WebDriver.php on line 729



FATAL ERROR. TESTS NOT FINISHED.
Call to a member function get() on null
in phar://D:/Training/codeception/codecept.phar/src/Codeception/Module/WebDriver
.php:729
this is the error on debug mode

当我从 Windows 10 机器上运行它时,它运行良好并执行验收测试。下面是我拥有的配置yml。

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
settings:
    bootstrap: _bootstrap.php
    colors: false
    memory_limit: 1024M
extensions:
    enabled:
        - Codeception\Extension\RunFailed

我使用的 Selenium Web 驱动程序版本是 3.4.0。PHP 版本为 5.6。我已经下载了最新的 chrome 驱动程序版本 2.30。我在这里做错了什么?任何帮助将不胜感激。

acceptance.suite.yml内容如下。

# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: https://www.google.com/
            browser: 'chrome'
        - \Helper\Acceptance
php selenium webdriver codeception chrome-web-driver

评论

0赞 Naktibalda 7/20/2017
请添加 .您使用的是最新版本的 Codeception 吗?acceptance.suite.yml
0赞 AnOldSoul 7/20/2017
我已经用内容编辑了问题。是的,我从网站上下载了最新的codecept.phar文件
0赞 David 10/15/2022
的 url 必须是本地域,通常也使用不带 like 。因此,它永远不必被混淆,任何人都永远无法访问,modules.enabled.WebDriver.urlhttpshttp://localhost/

答: 暂无答案