The way I did it before, and I don't think this part changed, was to run the test while developing it in a normal mode. So just remove the headless option from the config and watch what happens. For my test, everything was focused so I just had to close the tab/window and it would go back to the initial page and I could continue where I left. Maybe there is a better way, but I haven't used Dusk for 3 years now.
Jun 29, 2021
7
Level 5
Laravel dusk coming back to original browser tab
Hi, I have situation where I need to click the link and visit new tab and see if there is that particular text or not and then come back to original tab and perform some work.
this is the code I am using to go new tab when clicking view button
$window = collect($this->driver->getWindowHandles())->last();
$this->driver->switchTo()->window($window);
$browser->assertSee('Drop down');
Now I have to come to original tab, How can i do that ? Any help? Thanks
come back to original tab
Please or to participate in this conversation.