所以我正在做一个带有协同欺骗的自动测试。它在phpbrowser上工作得很好,但是我想测试的页面使用的是ajax,所以我按照codeception网站上的说明改成了webdriver。
我选择使用chromedriver,因为我只打算用chrome做这个测试,但它返回给我这个错误
Acceptance Tests (1) ---------------------------------------------------------------------------------------------------
FirstCest: Login successfully
Signature: FirstCest:loginSuccessfully
Test: tests\acceptance\FirstCest.php:loginSuccessfully
Scenario --
ERROR
------------------------------------------------------------------------------------------------------------------------
Time: 722 ms, Memory: 8.00 MB
There was 1 error:
---------
1) FirstCest: Login successfully
Test tests\acceptance\FirstCest.php:loginSuccessfully
[Facebook\WebDriver\Exception\WebDriverException] JSON decoding of remote response failed.
Error code: 4
The response: 'unknown command: wd/hub/session'
#1 D:\Programas\xampp\htdocs\autTest\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:298
#2 D:\Programas\xampp\htdocs\autTest\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:126
#3 D:\Programas\xampp\htdocs\autTest\vendor\symfony\event-dispatcher\EventDispatcher.php:212
#4 D:\Programas\xampp\htdocs\autTest\vendor\symfony\event-dispatcher\EventDispatcher.php:44
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.我尝试将chromedriver.exe更改为chrome的安装路径,但仍然是一样的。我真的不知道如何为chromedriver配置url,因为它只是一个.exe。
这是我在共骗中的接受套件,以防万一:
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
url: 'http://localhost/ASTechOLE/login.php'
window_size: false # disabled in ChromeDriver
port: 9515
browser: chrome
capabilities:
"goog:chromeOptions": # additional chrome options
- \Helper\Acceptance提前感谢
更新:我用./chromedriver --url-base=/wd/hub运行了chromedriver,现在它给了我
There was 1 error:
---------
1) FirstCest: Login successfully
Test tests\acceptance\FirstCest.php:loginSuccessfully
[Facebook\WebDriver\Exception\WebDriverException] JSON decoding of remote response failed.
Error code: 4
The response: 'unhandled request'
#1 D:\Programas\xampp\htdocs\autTest\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:298
#2 D:\Programas\xampp\htdocs\autTest\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:126
#3 D:\Programas\xampp\htdocs\autTest\vendor\symfony\event-dispatcher\EventDispatcher.php:212
#4 D:\Programas\xampp\htdocs\autTest\vendor\symfony\event-dispatcher\EventDispatcher.php:44
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.发布于 2019-07-25 21:12:05
根据您的堆栈跟踪,您似乎是在Windows中工作。尝试运行不带前导斜杠的chromedriver,用wd/hub代替/wd/hub。
您的命令将变为:./chromedriver --url-base=wd/hub。
我知道,Windows有时会很“有趣”:)
https://stackoverflow.com/questions/55845580
复制相似问题