Skip to content

storeConsoleLog no longer working on new versions #1178

@mshamaseen

Description

@mshamaseen

Dusk Version

v8.3.3

Laravel Version

12.35.0

PHP Version

8.4

PHPUnit Version

11.5.42

Database Driver & Version

Postgress

Description

console log is no longer stored on new versions.
running storeConsoleLog do nothing.

Steps To Reproduce

I have setup a new Laravel application, I used sail, after setting everything using the documentation sail dusk passes:

 PASS  Tests\Browser\ExampleTest
  ✓ basic example                                                                                                                                                                                                            0.79s  

  Tests:    1 passed (1 assertions)
  Duration: 0.94s

now chaning the test code to:

public function testBasicExample(): void
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/');
            $browser->script('console.log("Laravel");');

            $browser->storeConsoleLog('testlog.log')
                    ->assertSee('Laravel');
        });
    }

There is no testlog.log.

I faced that issue for quite a while on my project, so I decided to make a fresh Laravel installation to make sure there is nothing wrong with my project config.

also, from ChatGPT:

With these versions you are running fully W3C WebDriver mode.
That means the old JSON-Wire /session/:id/log endpoint is removed by ChromeDriver/Selenium — so:

storeConsoleLog() will always return null or empty for type browser.
Browser console logs must now be read via Chrome DevTools Protocol (CDP), not the old getLog() API.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions