I'm trying to run a bunch of tests on selenium. after every test I was using driver.quit() method but using this method does not free the ram and I run out of memory after I while. I changed it with driver.close() and it works great. After reading about both methods for a while I am still expecting the opposite. What is the reason of this behaviour ?
Here is my code:
<?php
$driver = RemoteWebDriver::create(env("SELENIUM_HOST"), DesiredCapabilities::chrome());
$driver->get($url);
$driver->findElement(WebDriverBy::cssSelector('#selector'))->getText();
$driver->close();
// or : $driver->quit();