Codeception中无法解释的WebDriver错误

时间:2016-05-19 17:00:19

标签: laravel selenium phantomjs codeception

我正在迁移到Codeception,进行验收测试。

这是我的accepted.yml

class_name: AcceptanceTester
modules:
  enabled:
      - WebDriver
      - \Helper\Acceptance
      - Db

  config:
    WebDriver:
        url: 'http://laravel.dev'
        browser: 'phantomjs'
    Db:
        dsn: 'mysql:host=laravel.dev;dbname=test'
        user: 'homestead'
        password: 'secret'

当我使用Webdriver时,我的测试中出现错误,我遇到了这种错误,这无济于事:

[Facebook\WebDriver\Exception\WebDriverException]                                                                                                                                                      
JSON decoding of remote response failed.                                                                                                                                                               
Error code: 4                                                                                                                                                                                          
The response: 'Invalid Command Method - Request => {"headers": {"Accept":"application/json","Content-Length":"0","Content- Type":"application/json;charset=UTF- 8","Host":"127.0.0.1:4444"},"httpVersion  
 ":"1.1","method":"GET","url":"/log/types","urlParsed": {"anchor":"","query":"","file":"types","directory":"/log/","path":"/log/t ypes","relative":"/log/types","port":"","host":"","password":"","user"  
     :"","userInfo":"","authority":"","protocol":"","source":"/log/types","que ryKey":{},"chunks":["log","types"]},"urlOriginal":"/session/44be5ec0- 1de2-11e6-ac4e-297abcf5a22b/log/types"}'  

当我为Laravel5更改WebDriver时,(但文档说不要将它用于验收测试。)我的错误不是明确的,如:

1) AuthTestCept (tests/acceptance/AuthTestCept.php)

Step  I click "#choose-account-0"
Fail  Link or Button by name or CSS or XPath element with '#choose-account-0' was not found.

Scenario Steps:

3. $I->click("#choose-account-0") at tests/acceptance/AuthTestCept.php:33
2. $I->click("#google") at tests/acceptance/AuthTestCept.php:32

所以,我对此有点恼火......任何方法都可以使用WebDriver清除错误???

0 个答案:

没有答案