As I mentioned in a survey of the php and selenium landscape I hinted that I was going to likely create my own PHP WebDriver implementation. And sorta have.
- Distributed via PEAR – which sounds simple, but meant that some class name changes to meet the PEAR conventions for things rather than just Facebook’s.
- Added the WebDriverWait class
- Added ActionChains (even if a bunch of them do not yet have implementations)
- Cleaning up the interface a bit to be less tightly coupled to the WebDriver wire protocol
To get started with PHPWebDriver you need to have a working PEAR installation (which can be a bit of a challenge…)
$ sudo pear channel-discover element-34.github.com/pear $ sudo pear install -f element-34/PHPWebDriver
For now, the best documentation is available in the project’s README but examples are slowly starting to show up in this blog too.
PHPWebDriver is Open Source and distributed under the Apache 2 license (as is the rest of the Selenium suite) which means you are free to use it without having to pay me a cent. I am however offering commercial support and priority bug fixing; contact me for information.
There is no official PHP binding for WebDriver, and this one is not either. But it takes the one that was closest to the core protocol, makes it distributable in the PHP’s package system and adds the bits of the WebDriver suite not specified in the protocol.