php-webdriver/webdriver
PHP bindings for Selenium WebDriver. Drive real browsers from PHP via W3C WebDriver (and legacy JsonWireProtocol), compatible with Selenium 2–4. Install via Composer and connect to Selenium Server or other remote ends for automation/testing.
\Throwable, to allow better work with exception methods when catching \PhpWebDriverExceptionInterface.null|int|float for W3C Webdriver (while keeping only int|float allowed for JsonWire protocol).new flag from headless chrome, as it is already default since Chromedriver 132.DISABLE_HEADLESS environment variable.symfony/process dependency to support upcoming Symfony 7.ChromeOptions::CAPABILITY_W3C used to set ChromeOptions is now deprecated in favor of ChromeOptions::CAPABILITY, which now also contains the W3C compatible value (goog:chromeOptions).goog:chromeOptions, even in the deprecated OSS JsonWire payload (as ChromeDriver supports this since 2017).<select multilpe> element.PhpWebDriverExceptionInterface as a common interface to identify all exceptions thrown in php-webdriver.createBySessionID().UnexpectedResponseException instead of UnknownErrorException in findElement() and findElements() methods.isDisplayed() and capabilities are missing in WebDriver instance. (Happens when driver instance was created using RemoteWebDriver::createBySessionID().)FirefoxProfile using addExtension() method.setProfile() method to FirefoxOptions, which is now a preferred way to set Firefox Profile.isDisplayed() can now be used even for browsers not supporting native API endpoint (like Safari), thanks to javascript atom workaround.WebDriverException is thrown if WebDriver returns empty or invalid screenshot data.FirefoxDriver::PROFILE constant. Instead, use setProfile() method of FirefoxOptions to set Firefox Profile.getAllSessions() method of RemoteWebDriver (which is not part of W3C WebDriver).UnknownErrorException instead of fatal error if remote end returns invalid response for findElement()/findElements() commands.getAttribute() and getDomProperty().static:: when accessing private property in DesiredCapabilities.Cookie class.findElement()/findElements() method documentation to better explain XPath behavior.[@return](https://github.com/return) and [@param](https://github.com/param) type annotations to Cookie class to avoid deprecations in PHP 8.1.RemoteWebElement::getDomProperty() method to read JavaScript properties of an element (like the value of innerHTML etc.) in W3C mode.WebDriverCommand::newSession() constructor to create new session command without violating typehints.RemoteWebElement::getLocationOnScreenOnceScrolledIntoView() was missing polyfill implementation for W3C mode and not working in eg. Safari.FirefoxOptions class to simplify passing Firefox capabilities. Usage is covered in our wiki.FirefoxDriver to easy local start of Firefox instance without a need to start the geckodriver process manually. See wiki for usage examples.ChromeDriver::startUsingDriverService() to be used for creating ChromeDriver instance with custom service.ChromeDriver::startSession. However, the method was supposed to be used only internally.$driver->switchTo()->newWindow().ChromeDriver::start(), it has always been unintentionally started in OSS mode.ChromeOptions::CAPABILITY_W3C.<a> element in Firefox (workaround for GeckoDriver bug 1374283).DriverServerDiedException on local driver process terminating unexpectedly and provide full details of original exception to improve debugging.WEBDRIVER_CHROME_DRIVER environment variable to be set if chromedriver binary is already available via system PATH.RemoteWebDriver::newWindow() in favor of $driver->switchTo()->newWindow().RemoteWebDriver::newWindow() for W3C mode to open new top-level browsing context (aka window).alertIsPresent() condition working in W3C mode.RemoteWebDriver::create() cannot be used without providing the second parameter (which is in fact optional).ChromeDriver::start() starts in inconsistent state mixing W3C/OSS mode.binary value of goog:chromeOptions while keep the object in proper data type required by ChromeDriver.equals() method to be working in W3C mode.RemoteWebDriver created via createBySessionID() by default expects W3C mode. This could be disabled using fifth parameter of createBySessionID().createBySessionID().sendKeys() method. (Unintentional BC break in 1.8.0.)getStatus() method of RemoteWebDriver to get information about remote-end readiness to create new sessions.takeElementScreenshot() method of RemoteWebElement to do the obvious - take screenshot of the particular element.executeCustomCommand(). See wiki for more information.php-webdriver/php-webdriver.php-webdriver/webdriver and the original facebook/webdriver was marked as abandoned.webdriver.chrome.driver to WEBDRIVER_CHROME_DRIVER. However the old one also still works to keep backward compatibilitytakeScreenshot() or takeElementScreenshot() methods), they are automatically created.WebDriverNavigation and EventFiringWebDriverNavigation now both implement new WebDriverNavigationInterface.WebDriverExpectedCondition::presenceOfElementLocated() works correctly when used within WebDriverExpectedCondition::not().getCookies() (it was causing fatal error when there were no cookies).Call to a member function toArray() if capabilities were already converted to an array.WebDriverCheckboxes and WebDriverRadios helper classes to simplify interaction with checkboxes and radio buttons.visibilityOfAnyElementsLocated() method to WebDriverExpectedCondition.Constant CURLOPT_CONNECTTIMEOUT_MS already defined.Cookie value object instead of an array when passed to to addCookie() method of WebDriverOptions.getCookieNamed() and getCookies() methods of WebDriverOptions are now encapsulated in Cookie object instead of an plain array. The object implements ArrayAccess interface to provide backward compatibility.ext-zip is now specified as required dependency in composer.json (but the extension was already required by the code, though).WebDriverCapabilities::isJavascriptEnabled() method.textToBePresentInElementValue expected condition in favor of elementValueContains.null is passed to sendKeys().getCapabilities() method of RemoteWebDriver, to retrieve actual capabilities acknowledged by the remote driver on startup.RemoteWebDriver. (So far only desired capabilities were supported.)urlIs - current URL exactly equals given valueurlContains - current URL contains given texturlMatches - current URL matches regular expressiontitleMatches - current page title matches regular expressionelementTextIs - text in element exactly equals given textelementTextContains (as an alias for textToBePresentInElement) - text in element contains given textelementTextMatches - text in element matches regular expressionnumberOfWindowsToBe - number of opened windows equals given number<select> by its partial text (using selectByVisiblePartialText()).XPathEscaper helper class to quote XPaths containing both single and double quotes.WebDriverSelectInterface, to allow implementation of custom select-like components, eg. those not built around and actual select tag.Symfony\Process is used to start local WebDriver processes (when browsers are run directly, without Selenium server) to workaround some PHP bugs and improve portability.RemoteWebDriver class.setSessionID() and setCommandExecutor() methods of RemoteWebDriver class; these values should be immutable and thus passed only via constructor.WebDriverExpectedCondition::textToBePresentInElement() in favor of elementTextContains().(de)selectByIndex() and getAllSelectedOptions() methods of WebDriverSelect when used with non-multiple select element.select*() and deselect*() methods of WebDriverSelect.WebDriverBy and DesiredCapabilities classes easily extensible.ChromeDriver.WebDriverCommand and DesiredCapabilities.FirefoxDriver when open_basedir restriction is in effect.WebDriverWait.How can I help you explore Laravel packages today?