添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
急躁的投影仪  ·  DJI Air 3 vs Air 2S ...·  2 周前    · 
安静的春卷  ·  Pythonnet Hotfix for ...·  3 月前    · 
旅行中的啄木鸟  ·  How to read closed ...·  3 月前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are you trying to achieve?

I am trying to run a simple test and try to see what things I am doing wrong here, it's first time when I am setting up Codeception from scratch.

What do you get instead?

I have the following error:

[ConnectionException] Can't connect to Webdriver at http://selenium:4444/wd/hub . Please make sure that Selenium Server or PhantomJS is running.

Provide console output if related. Use -vvv mode for more details.

# paste output here

Provide test source code if related

// $I = new AcceptanceTester($scenario);
$I->wantTo('Login and check functionality');
//Login
$I->amOnPage('/user/account/login');
$I->waitForText('login');

Details

  • Codeception version:2.4.6
  • PHP Version:7.2.4
  • Operating System:Windows 10
  • Installation type: Phar || Composer
  • List of installed packages ( composer show )
    behat/gherkin v4.5.1 Gherkin DSL parser for PHP 5.3
    doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invok...
    facebook/webdriver 1.6.0 A PHP client for Selenium WebDriver
    guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
    guzzlehttp/promises v1.3.1 Guzzle promises library
    guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
    myclabs/deep-copy 1.8.1 Create deep copies (clones) of your objects
    phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (P...
    phar-io/version 2.0.1 Library for handling version information and constraints
    phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code stru...
    phpdocumentor/reflection-docblock 4.3.0 With this component, a library can provide support for annotations via D...
    phpdocumentor/type-resolver 0.4.0
    phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage 6.0.7 Library that provides collection, processing, and rendering functionalit...
    phpunit/php-file-iterator 2.0.1 FilterIterator implementation that filters files based on a list of suff...
    phpunit/php-text-template 1.2.1 Simple template engine.
    phpunit/php-timer 2.0.0 Utility class for timing
    phpunit/php-token-stream 3.0.0 Wrapper around PHP's tokenizer extension.
    phpunit/phpunit 7.3.5 The PHP Unit Testing framework.
    psr/http-message 1.0.1 Common interface for HTTP messages
    sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
    sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
    sebastian/diff 3.0.1 Diff implementation
    sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
    sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
    sebastian/global-state 2.0.0 Snapshotting of global state
    sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced...
    sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-publ...
    sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
    sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
    sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP pr...
    symfony/browser-kit v4.1.4 Symfony BrowserKit Component
    symfony/console v4.1.4 Symfony Console Component
    symfony/css-selector v4.1.4 Symfony CssSelector Component
    symfony/dom-crawler v4.1.4 Symfony DomCrawler Component
    symfony/event-dispatcher v4.1.4 Symfony EventDispatcher Component
    symfony/finder v4.1.4 Symfony Finder Component
    symfony/polyfill-ctype v1.9.0 Symfony polyfill for ctype functions
    symfony/polyfill-mbstring v1.9.0 Symfony polyfill for the Mbstring extension
    symfony/process v4.1.4 Symfony Process Component
    symfony/yaml v4.1.4 Symfony Yaml Component
    theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and po...
    webmozart/assert 1.3.0 Assertions to validate method input/output with nice error messages.
  • Suite configuration:
  • actor: Tester
    paths:
        tests: tests
        output: tests/_output
        data: tests/_data
        support: tests/_support
        envs: tests/_envs
    actor_suffix: Tester
    extensions:
        enabled:
        - Codeception\Extension\RunFailed
    modules:
        config:
                dsn: ''
                user: ''
                password: ''
                dump: tests/_data/dump.sql
    coverage:
        enabled: true
    Scan't connect to Webdriver although Selenium is running Can't connect to Webdriver although Selenium is running Sep 13, 2018 - Helper\Acceptance

    And now I have a different error:
    [Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: GeckoDriverService
    Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
    Driver info: driver.version: unknown

    Are you passing -Dwebdriver.gecko.driver=./geckodriver. parameter to Selenium with correct path to geckodriver?

    Also you must use Selenium 3.8 or older if you want to get it working with Codeception: #5083 (comment)

    Firefox is the pain in the ass for the last couple of years.

    Ok, so I am doing it like this now as I have Selenium 3.8.0:

    java -Dwebdriver.gecko.driver="geckodriver.exe" -jar selenium-server-standalone-3.8.0.jar

    but I am back with the same error when trying to run the test:

    ConnectionException] Can't connect to Webdriver at http://secureportal:4444/wd/hub . Please make sure that Selenium Server or PhantomJS is running.

    Same thing, same error.
    Debugger is throwing this before the error:

    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

    Having gekodriver geckodriver-v0.21.0-win64 and running it like this:

    java -Dwebdriver.gecko.driver="geckodriver.exe" -jar selenium-server-standalone-3.8.0.jar

    and also with selenium 3.8.0 as the version it fixed the error:

    Thank you for your help, I can close this one.