Open symfony/panther in existing browser window

710 Views Asked by At

I'm working on a test script in PHP using Symfony Panther where one of the requirements is to open the website to be tested in a browser window that is already open in the local machine as a new tab (I'm sort of indifferent if the browser is chrome or firefox but I've been using chrome for now).

The default behaviour of createChromeClient seem to be to open a completely new chrome window but that undermines my testing effort since I need to load the website within the same browser window as previous tests have been carried out in.

So the question is, is there a way in Panther or underlying libraries to configure the script to open in an existing chrome or firefox window?

My code as a reference point (I'm running the tests in Ubuntu 18.04 gnome by the way):

use Symfony\Component\Panther\Client;

require __DIR__.'/vendor/autoload.php'; 

$client = \Symfony\Component\Panther\Client::createChromeClient(null, [
            '--window-size=1200,1100',
            '--disable-gpu',
]);

$client->request('GET', 'https://example.com');

Thanks for your help in advance!

0

There are 0 best solutions below