php-webdriver -- A very thin wrapper of WebDriver
=================================================
## DESCRIPTION
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.
The function's return value is exactly what is returned from the server as part of the protocol definition. If an error is returned, the function will throw the appropriate WebDriverException instance.
## GETTING STARTED
* All you need as the server for this client is the selenium-server-standalone-#.jar file provided here: http://code.google.com/p/selenium/downloads/list
* Download and run that file, replacing # with the current server version.
java -jar selenium-server-standalone-#.jar
* Then when you create a session, be sure to pass the url to where your server is running.
// This would be the url of the host running the server-standalone.jar
$wd_host = 'http://localhost:4444/wd/hub'; // this is the default
$web_driver = new WebDriver($wd_host);
// First param to session() is the 'browserName' (default = 'firefox')
// Second param is a JSON object of additional 'desiredCapabilities'
// POST /session
$session = $web_driver->session('firefox');
* See also [wiki page for launching different browsers](https://github.com/facebook/php-webdriver/wiki/Launching-Browsers).
## SIMPLE EXAMPLES
### Note that all of these match the Protocol exactly
* Move to a specific spot on the screen
// POST /session/:sessionId/moveto
$session->moveto(array('xoffset' => 3, 'yoffset' => 300));
* Get the current url
// GET /session/:sessionId/url
$session->url();
* Change focus to another frame
// POST /session/:sessionId/frame
$session->frame(array('id' => 'some_frame_id'));
* Get a list of window handles for all open windows
// GET /session/:sessionId/window_handles
$session->window_handles();
* Accept the currently displayed alert dialog
// POST /session/:sessionId/accept_alert
$session->accept_alert();
* Change asynchronous script timeout
// POST /session/:sessionId/timeouts/async_script
$session->timeouts()->async_script(array('ms' => 2000));
* Doubleclick an element on a touch screen
// POST session/:sessionId/touch/doubleclick
$session->touch()->doubleclick(array('element' => $element->getID())
* Check if two elements are equal
// GET /session/:sessionId/element/:id/equals/:other
$element->equals($other_element->getID()))
* Get value of a css property on element
// GET /session/:sessionId/element/:id/css/:propertyName
$element->css($property_name)
## 'GET', 'POST', or 'DELETE' to the same command examples
### When you can do multiple http methods for the same command, call the command directly for the 'GET', and prepend the http method for the 'POST' or 'DELETE'.
* Set landscape orientation with 'POST'
// POST /session/:sessionId/orientation
$session->postOrientation(array('orientation' => 'LANDSCAPE'));
* Get landscape orientation with normal 'GET'
// GET /session/:sessionId/orientation
$session->orientation();
* Set size of window that has $window_handle with 'POST'
// If excluded, $window_handle defaults to 'current'
// POST /session/:sessionId/window/:windowHandle/size
$session
->window($window_handle)
->postSize(array('width' => 10, 'height' => 10));
* Get current window size with 'GET'
// GET /session/:sessionId/window/:windowHandle/size
$session->window()->size();
## Some unavoidable exceptions to direct protocol translation.
* Opening pages
// POST /session/:sessionId/url
$session->open('http://www.facebook.com');
* Dealing with the session
// DELETE /session/:sessionId
$session->close();
// GET /session/:sessionId
$session->capabilities();
* To find elements
// POST /session/:sessionId/element
$element = $session->element($using, $value);
// POST /session/:sessionId/elements
$session->elements($using, $value);
// POST /session/:sessionId/element/:id/element
$element->element($using, $value);
// POST /session/:sessionId/element/:id/elements
$element->elements($using, $value);
* To get the active element
// POST /session/:sessionId/element/active
$session->activeElement();
* To manipulate cookies
// GET /session/:sessionId/cookie
$session->getAllCookies();
// POST /session/:sessionId/cookie
$session->setCookie($cookie_json);
// DELETE /session/:sessionId/cookie
$session->deleteAllCookies()
// DELETE /session/:sessionId/cookie/:name
$session->deleteCookie($name)
* To manipulate windows
// POST /session/:sessionId/window
$session->focusWindow($window_handle);
// DELETE /session/:sessionId/window
$session->deleteWindow();
### See also [wiki page of examples](https://github.com/facebook/php-webdriver/wiki/Example-command-reference).
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码-GxlcmsQY企业建站系统 php版.zip
共1117个文件
gif:281个
png:260个
php:174个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 5 浏览量
2022-11-21
09:18:14
上传
评论
收藏 8.23MB ZIP 举报
温馨提示
PHP实例开发源码—GxlcmsQY企业建站系统 php版.zip PHP实例开发源码—GxlcmsQY企业建站系统 php版.zip PHP实例开发源码—GxlcmsQY企业建站系统 php版.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码-GxlcmsQY企业建站系统 php版.zip (1117个子文件)
make.bat 4KB
build.bat 456B
compress.bat 98B
all-ie.bat 47B
all-firefox.bat 35B
all-chrome.bat 34B
nginx.conf 530B
theme.conf 65B
main.css 266KB
firebug.css 68KB
firebug.css 66KB
firebug.css 66KB
firebug.css 66KB
firebug.css 66KB
jquery-ui-1.9.2.custom.css 30KB
jquery-ui-1.9.2.custom.min.css 26KB
default.css 21KB
firebug-1.3a2.css 16KB
firebug-1.3a2.css 16KB
firebug-1.3a2.css 16KB
style.css 13KB
imgshare.css 10KB
admin-style.css 9KB
basic.css 5KB
share_popup.css 5KB
qunit.css 4KB
share_style0_16.css 4KB
qq.css 3KB
simple.css 2KB
install.css 2KB
admin-top.css 2KB
jquery.jqmodal.css 1KB
prettify.css 973B
admin-left.css 882B
firebug.IE6.css 672B
firebug.IE6.css 672B
firebug.IE6.css 672B
admin-login.css 600B
index.css 282B
classy.css_t 4KB
pinyin.dat 53KB
static.gif 35KB
35.gif 13KB
42.gif 13KB
40.gif 10KB
18.gif 8KB
19.gif 8KB
11.gif 8KB
firebug_upload_json.gif 7KB
32.gif 7KB
49.gif 6KB
29.gif 6KB
login.gif 5KB
97.gif 5KB
65.gif 5KB
31.gif 5KB
46.gif 5KB
57.gif 5KB
45.gif 5KB
8.gif 5KB
left_bg_hover.gif 5KB
shadow.gif 4KB
shadow.gif 4KB
shadow.gif 4KB
shadow.gif 4KB
shadow.gif 4KB
43.gif 4KB
33.gif 4KB
68.gif 4KB
26.gif 4KB
14.gif 4KB
7.gif 4KB
51.gif 4KB
10.gif 4KB
47.gif 4KB
72.gif 4KB
6.gif 3KB
94.gif 3KB
84.gif 3KB
41.gif 3KB
17.gif 3KB
9.gif 3KB
28.gif 3KB
php.gif 3KB
shadow2.gif 3KB
shadow2.gif 3KB
shadow2.gif 3KB
shadow2.gif 3KB
shadow2.gif 3KB
50.gif 3KB
95.gif 3KB
22.gif 3KB
27.gif 3KB
67.gif 3KB
90.gif 3KB
60.gif 3KB
loading.gif 3KB
58.gif 3KB
74.gif 2KB
25.gif 2KB
共 1117 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
毕业_设计
- 粉丝: 1935
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功