ikr/php-webdriver-journal
最新稳定版本:v0.1.4
Composer 安装命令:
composer require ikr/php-webdriver-journal
包简介
A journaling proxy object over the Facebook's WebDriver
README 文档
README
Summary
A journaling proxy to the Facebook's WebDriver. Wraps a
WebDriver instance, and complements the original method calls with taking screen-shots, and
capturing the browser log messages. As the result, a journal of the executed browser session is
created: an HTML document with embedded screen-shots, DOM query records, console messages, etc.
Why?
We have an automatic headless screen-scraping tool implemented with Selenium + PhantomJS (no idea why PhantomJS by itself wasn't enough). Sometimes it screws up: ticket order fails, wrong kind of tickets gets selected, or a child name gets confused with an adult name. This tool is summoned to ease the debugging of such failures.
Installation
$ composer require ikr/php-webdriver-journal
API
$driver = \RemoteWebDriver::create( $seleniumHubUrl, \DesiredCapabilities::phantomjs() ); $wrappedDriver = new \WebDriverJournal\WebDriverProxy( $driver, new \WebDriverJournal\Probe( $driver, new \WebDriverJournal\Journal( new \WebDriverJournal\DirectoryFilesWriter( '/tmp/web-driver-journals', $browserSessionIdOfYourChoice ) ) ) ); $wrappedDriver->manage()->window()->setSize(new \WebDriverDimension(1024, 1024)); $wrappedDriver->manage()->timeouts()->implicitlyWait(8); $wrappedDriver->get('https://ikr.su/'); $wrappedDriver->findElement(\WebDriverBy::id('btn-next'))->click(); // ... $wrappedDriver->quit();
Maturity
Still experimental: v0.1.x
统计信息
- 总下载量: 97
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-09