0

i use mink chrome driver with Behat\Mink.

i have a simple cronjob that run each minute. when my code run, the chrome open the login url correctly and successfully login to the site.

$mink = new Mink(array('browser' => new Session(new ChromeDriver('http://localhost:9222', null, 'http://www.google.com'))));
$mink->setDefaultSessionName('browser');
$session = $mink->getSession();
$session->visit('https://www.example.com/login/');

$loginForm = $session->getPage()->find('css', 'form');
$loginForm->find('css', '[name=username]')->setValue('myUsername');
$loginForm->find('css', '[name=password]')->setValue('myPassword');
// do somethings...

but at end of that process, the browser reset automatically (close all tabs and clear all cookie!)

how i can prevent from this? i want the browser remain logged in!

علیرضا
  • 2,434
  • 1
  • 27
  • 33

0 Answers0