Codeception / Codeception/module-webdriver

Could not start a new session. Error while creating session with the driver service

Open
#112 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
39
Forks
25
PR merge metrics
No merged PRs in 30d

Description

#### What are you trying to achieve?
Run codeception in Docker using standalone selenium server

#### What do you get instead?
[Error] Class name must be a valid object or a string

NOTE: Since the above seems to be an issue external to the tests (as I removed all the actuals tests--see PHP section below) I debugged through and found that the issue was happening within the foreach loop in \PhpUnit\TextUi\DefaultResultPrinter::printDefects() when it calls `$this->printDefect()`.
In a dump of `$defect`, I found the following:

[message] => Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Driver server process died prematurely.

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

```bash
Codeception PHP Testing Framework v4.1.28
Powered by PHPUnit 9.5.12 by Sebastian Bergmann and contributors.

Acceptance Tests (1) -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
E LoginCest: Login page has form test (0.00s)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 00:04.366, Memory: 10.00 MB

There was 1 error:

---------
1) LoginCest: Login page has form test
Test tests/acceptance/LoginCest.php:loginPageHasFormTest

[Error] Class name must be a valid object or a string

Artifacts:

Png: /var/www/app/tests/_output/acceptance.LoginCest.loginPageHasFormTest.fail.png
Html: /var/www/app/tests/_output/acceptance.LoginCest.loginPageHasFormTest.fail.html

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.```
> Provide test source code if related

```php

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.