带有Chrome的Selenium Server使用Codeception RunProcess问题

时间:2018-10-01 22:24:37

标签: selenium selenium-webdriver selenium-chromedriver

我正在考虑将Selenium Server与Chrome一起使用Codeception框架进行浏览器接受测试。在Windows 10计算机上本地工作。

我的accept.suite.yml:

actor: AcceptanceTester

extensions:
    enabled:
        - Codeception\Extension\RunProcess:
            - php -S 127.0.0.1:4444
            - java -jar selenium-server-standalone-3.14.0.jar

modules:
    enabled:
        - WebDriver:
            url: 'http://mysite.dev/'
            browser: chrome
            host: localhost
            port: 4444
            window_size: 1024x768
            restart: true
        - Asserts
        - \Helper\AcceptanceInternal

从命令行运行我的测试,它将启动selenium,但是测试失败并显示以下错误:

AcceptanceInternal Tests (12) ------------------------------

  [RunProcess] Starting php -S 127.0.0.1:4444
  [RunProcess] Starting java -jar selenium-server-standalone-3.14.0.jar
1) ProductControllerCest: Cannot view index without logging in
 Test  tests/acceptanceInternal/Controller/Internal/ProductControllerCest.php:notLoggedInIndex



  [Facebook\WebDriver\Exception\WebDriverException] JSON decoding of remote response failed.
Error code: 4
The response: '\<!doctype html>\<html>\<head>\<title>404 Not Found\</title>\<style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
\</style>
\</head>\<body>\<h1>Not Found\</h1>\<p>The requested resource \<code class="url">/wd/hub/session\</code> was not found on this server.\</p>\</body>\</html>'

但是,如果我在浏览器中访问,则会看到硒: http://localhost:4444/wd/hub/static/resource/hub.html

关于这里可能出什么问题的任何建议吗?

0 个答案:

没有答案