ashar443 / fbdriver
WebDriver的PHP客户端
Requires
- php: >=5.3.19
- ext-curl: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.11
- phpunit/phpunit: 4.6.* || ~5.0
- squizlabs/php_codesniffer: ^2.6
Suggests
This package is not auto-updated.
Last update: 2024-09-28 19:47:32 UTC
README
描述
Php-webdriver库是Selenium WebDriver的PHP语言绑定,允许您从PHP控制浏览器。
此WebDriver客户端旨在尽可能接近其他语言的绑定。这些概念与WebDriver的Java、.NET、Python和Ruby绑定非常相似。
这是PHP客户端的新版本,从2013年开始重写。使用旧版本?请查看Adam Goucher的分支https://github.com/Element-34/php-webdriver
寻找php-webdriver的API文档?请参阅https://fbdocs.cn/php-webdriver/
有任何投诉、问题或想法?您可以在用户组https://#/groups/phpwebdriver/上发布。
安装
可以使用Composer进行安装。
如果您尚未使用Composer,可以下载composer.phar
二进制文件
curl -sS https://getcomposer.org/installer | php
然后安装库
php composer.phar require facebook/webdriver
入门
此客户端所需的唯一服务器是此处提供的selenium-server-standalone-#.jar
文件:http://selenium-release.storage.googleapis.com/index.html
下载并运行该文件,将#替换为当前服务器版本。
java -jar selenium-server-standalone-#.jar
然后创建会话时,请确保传递服务器运行的URL。
// This would be the url of the host running the server-standalone.jar $host = 'https://:4444/wd/hub'; // this is the default
-
启动Firefox
$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
-
启动Chrome
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
您还可以自定义期望的能力
$desired_capabilities = DesiredCapabilities::firefox(); $desired_capabilities->setCapability('acceptSslCerts', false); $driver = RemoteWebDriver::create($host, $desired_capabilities);
变更日志
有关最新更改,请参阅CHANGELOG.md文件。
更多信息
请参阅Selenium文档和维基http://docs.seleniumhq.org/docs/和https://code.google.com/p/selenium/wiki
支持
我们有一个愿意尝试并帮助您的优秀社区!
目前我们提供两种支持方式
通过我们的Facebook群组
如果您有疑问或是一个活跃的贡献者,请考虑加入我们的Facebook群组并参与公共讨论和支持
https://#/groups/phpwebdriver/
通过Github
如果您正在阅读此内容,您已经找到了我们的GitHub存储库。如果您有任何问题,请随时将其作为问题提交,我们的工作人员将尽快提供帮助。
贡献
Ashar Javed Virk Asist: Mubin