首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chromedriver不支持协同欺骗

Chromedriver不支持协同欺骗
EN

Stack Overflow用户
提问于 2019-04-25 17:04:07
回答 1查看 951关注 0票数 1

所以我正在做一个带有协同欺骗的自动测试。它在phpbrowser上工作得很好,但是我想测试的页面使用的是ajax,所以我按照codeception网站上的说明改成了webdriver。

我选择使用chromedriver,因为我只打算用chrome做这个测试,但它返回给我这个错误

代码语言:javascript
复制
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。

这是我在共骗中的接受套件,以防万一:

代码语言:javascript
复制
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,现在它给了我

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2019-07-25 21:12:05

根据您的堆栈跟踪,您似乎是在Windows中工作。尝试运行不带前导斜杠的chromedriver,用wd/hub代替/wd/hub

您的命令将变为:./chromedriver --url-base=wd/hub

我知道,Windows有时会很“有趣”:)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55845580

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档