| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This client aims to be as thin as possible, abusing the dynamic nature of PHP to allow almost all API calls to be a direct transformation of what is defined in the WebDriver protocol itself.
Most clients require you to first read the protocol to see what's possible, then study the client itself to see how to call it. This hopes to eliminate the latter step, and invites you to rely almost exclusively on http://code.google.com/p/selenium/wiki/JsonWireProtocol
Each command is just the name of a function call, and each additional path is just another chained function call. The function parameter is then either an array() if the command takes JSON parameters, or an individual primitive if it takes a URL parameter.
Get a session (opens a new browser window)
$web_driver = new WebDriver(); // could pass a host besides localhost
$session = $web_driver->session(); // could pass a browser name
Move to a specific spot on the screen
$session->moveto(array('xoffset' => 3, 'yoffset' => 300));
Change asynchronous script timeout
$session->timeouts()->async_script(array('ms' => 2000));
Touch screen
$session->touch()->scroll($element->getID())
Check if two elements are equal
$element->equals($other_element->getID()))
Get value of css property on element
$element->css($property_name)
Set landscape orientation
$session->postOrientation(array('orientation' => 'LANDSCAPE'));
Get landscape orientation
$session->orientation();
| Back | FazBrowse Home | New Git URL |