Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Blaze's avatar

Laravel console dusk Within Frame click not working

Hi, I’m running into an issue with Laravel Dusk when trying to click a button inside an iframe.

Here’s the relevant part of my command:

$this->browse(function ($browser) {
    $browser->visit('example.com')
        ->pressAndWaitFor('test', 5)
        ->withinFrame("#widget-modal", function (\Laravel\Dusk\Browser $browser) {
            $browser->screenshot('before-click')
                ->pressAndWaitFor('Continue', 5)
                ->screenshot('after-click');
        });
});

Problem:

The Continue button is visible inside the frame.

Both before-click and after-click screenshots still show the Continue button in the same state.

It seems like the click action is not being triggered, or Dusk is unable to properly interact with the element inside the iframe.

What I expected:

After calling pressAndWaitFor('Continue', 5), the modal or iframe content should change, but it does not.

0 likes
0 replies

Please or to participate in this conversation.