自动化测试工具,Selenium v2.45.0 发布

jopen 9年前

  Selenium 是 Thoughtworks公司的一个集成测试的强大工具。Selenium 是 ThoughtWorks 专门为 Web 应 用程序编写的一个验收测试工具。与其他测试工具相比,使用 Selenium 的最大好处是: Selenium 测试直接在浏览器中运行,就像真实用户 所做的一样。Selenium 测试可以在 Windows、Linux 和 MacintoshAnd 上的 Internet Explorer、 Mozilla 和 Firefox 中运行。其他测试工具都不能覆盖如此多的平台。
   Selenium 不同于一般的测试工具。一般的脚本测试工具录制脚本,实际上都是通过拦截浏览器收发的http 请求来实现的。事实上并没有办法 录制用户对html 页面的操作。Selenium 的脚本录制工具是通过监听用户对html 页面的操作来录制脚本的。Selenium是真正能够监听 用户对html 页面的操作的录制工具。Selenium 完全了解用户操作的html 页面。
selenium原理:
SeleniumServer 通过网络与Selenium 客户端通讯,接收Selenium 测试指令。
SeleniumServer 通过向浏览器发出JavaScript 调用实现对Html 页面的全面追踪,并通过网络把执行结果返回给Selenium 客户端。
Selenium 客户端一般使用单元测试技术实现,通过判断返回的结果与预期是否一致来决定程序是否运行正确。
Selenium 是通过javascript 来实现对Html 页面的操作的。它提供了丰富的指定Html 页面元素和操作页面元素的方法。
Selenium 打开浏览器时,把自己的JavaScript 文件嵌入网页中。然后Selenium 的网页通过frame 嵌入目标网页。这样,就可以使用Selenium 的JavaScript 对象来控制目标网页。
Selenium 的JavaScript 对象中,最重要的就是Selenium 对象。它的作用是代表Java 中的Selenium 接口执行一系列的命令,让浏览器执行。


Selenium v2.45.0 发布,此版本现已提供下载http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar。此版本支持 Firefox 36,更新内容如下:

v2.45.0  =======    Important changes in this release:    * Native events in Firefox relied on an API that Mozilla no longer    provides. As such, fall back to synthesized events on recent Firefox    versions.    Other changes:    * When Selenium is unable to interact with an element, such as the    case when an element is missing or disabled, this change will output    exactly how Selenium is attempting to locate the element, such as    the XPath or id of the element. This greatly speeds up    troubleshooting issues, as the exception message clearly states what    element is broken/missing for common problems like an    ElementNotFoundException.  * improve ByCssSelector#toString  * Remove automatic installation of the SafariDriver in Java.  * Complete Selenium Java Server support for Blink based Opera  * Upgrading PhantomJS driver  * Pull HttpClient implementation details out of HttpCommandExecutor.  * Fix issue 8254: Extensions were incorrectly transferred between    Windows client and Linux grid node, because ZipEntry had incorrect    name with '\' as separators.  * Adding capabilities and browser type for Opera Blink, and    configuring tests to run in Opera Blink  * Adding support for Blink-based Opera to Java binding  * Adding Yosemite platform  * Allowing to set an arbitrary platform capability even if it can't be    converted to Platform enum. Non-standard platform values can cause    matching issues on Grid, but they can be usable for third-party Grid    implementations  * Taking XML namespaces into account when searching by XPath. Checked    to work in Firefox. Chrome supports namespaces out of the box. Need    to update IE and Safari drivers to use the updated atom and test    them carefully.