So the basic spiel, "I am new to this thing" called Selenium using Facebook's PHP Webdriver (https://github.com/facebook/php-webdriver) and I cannot find anything that matches "How to open a new tab in chrome" using this particular technology. Any help will be very much appreciated.
A virtual cup of coffee to you, kind programmer!
New way to do it since php-webdriver 1.10.0:
// Default behavior, without specifying window type
$driver->switchTo()->newWindow();
// Open new window
$driver->switchTo()->newWindow(WebDriverTargetLocator::WINDOW_TYPE_WINDOW);
// Open new tab
$driver->switchTo()->newWindow(WebDriverTargetLocator::WINDOW_TYPE_TAB);
$driver->switchTo()->window($driver->getWindowHandles()[1]);
See doucmentation for more examples.
You can go with JS solution like:
$webdriver->executeScript("window.open('". $url ."','_blank');", array());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With