The Bndr
The Bndr

Reputation: 13394

codeception WebDriver irgnores url Parameter

I like to use codeception acceptance test to test my PHP Application.

For this I have an acceptance.suite.yml configuration, like this:

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: "http://myserver"
            window_size: false # disabled in ChromeDriver
            port: 9515
            browser: chrome
            capabilities:
                chromeOptions:
                    args: ["--headless", "--disable-gpu"] # Run Chrome in headless mode
                    prefs:
                        download.default_directory: "/tmp"
        - Yii2:
            part: orm
            entryScript: index-test.php
            cleanup: false

When I start the test codecept run I get the following error: [ConnectionException] Can't connect to WebDriver at http://127.0.0.1:9515/wd/hub. Make sure that ChromeDriver, GeckoDriver or Selenium Server is running.

This is strange, because url is set to http://myserver, which is not localhost.

Question: Why codecept tries to use localhost instead of http://myserver?

I also changes the port to make sure, this config-file is really used. So I found out, that the config-file is used an the port: parameter in the acceptance.suite.yml really comes form this file. Only the url: parameter seams not to have an any effect.

Any idea?

Upvotes: 0

Views: 333

Answers (1)

Naktibalda
Naktibalda

Reputation: 14120

Codeception connects to WebDriver daemon, e.g. Chromedriver, and then WebDriver connects to URL.

In your case it fails to connect to WebDriver.
Have you got Chromedriver running on your computer?
If it is running on different machine, you can specify it using hostparameter.

Upvotes: 0

Related Questions