跳转到主要内容

WebDriver Plus.

项目描述

使用Python Selenium最简单、最强大的方式

WebDriver Plus是Selenium WebDriver Python绑定的扩展,它为您提供了更简洁、更易于表达的应用程序接口。

它帮助您快速编写可读性高、健壮的测试。

WebDriver Plus有什么优点?

  • 支持池化和自动退出的浏览器实例。

  • 用于查找元素的简洁API,以及广泛的选择器。

  • 使用JQuery风格的遍历和过滤定位元素,无需使用复杂的xpath表达式。

  • 在不使用ActionChains的情况下对元素执行操作。

  • 元素高亮显示使得在Python控制台中进行工作变得愉快。

注意:如果您有兴趣长期维护WebDriver Plus,请与我们联系。目前,作者的多数开源时间都致力于Django REST框架的开发。

入门指南

使用pip安装webdriverplus

pip安装webdriverplus

现在启动您的Python控制台…

>>> from webdriverplus import WebDriver
>>> browser = WebDriver().get('http://www.google.com')

好的,让我们进行搜索。

>>> browser.find(name='q').send_keys('selenium\n')

现在让我们获取所有搜索结果的大纲。

>>> browser.find(id='search').find('h3')
WebElementSet(
  <h3 class="r"><a href="http://seleniumhq.org/" class="l" onmousedown="retur...
  <h3 class="r"><a href="http://www.google.co.uk/url?sa=t&amp;rct=j&amp;q=sel...
  <h3 class="r"><a href="http://en.wikipedia.org/wiki/Selenium" class="l" onm...
  <h3 class="r"><a href="http://en.wikipedia.org/wiki/Selenium_%28software%29...
  <h3 class="r"><a href="http://ods.od.nih.gov/factsheets/selenium" class="l"...
  <h3 class="r"><a href="http://www.nlm.nih.gov/medlineplus/druginfo/natural/...
  <h3 class="r"><a href="http://www.hollandandbarrett.com/selenium-050" class...
  <h3 class="r"><a href="http://www.whfoods.com/genpage.php?dbid=95&amp;tname...
  <h3 class="r"><a href="http://www.patient.co.uk/doctor/Selenium.htm" class=...
  <h3 class="r"><a href="/search?q=selenium&amp;hl=en&amp;biw=940&amp;bih=938...
  <h3 class="r"><a href="http://www.umm.edu/altmed/articles/selenium-000325.h...
)

请注意,WebDriver Plus 已经为您突出显示了所选元素,这对于您编写测试并确保选择正确的元素非常有帮助。

https://raw.github.com/tomchristie/webdriverplus/master/docs/screenshot.png

下一步

准备好开始时,请访问完整文档(http://webdriver-plus.readthedocs.org/)。

如果您想为项目做出贡献,请阅读贡献指南(http://webdriver-plus.readthedocs.org/en/latest/topics/contributing.html

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

webdriverplus-0.1.5.tar.gz (12.9 kB 查看哈希值)

上传时间

由...