Selenium(ThoughtWorks公司开发的web自动化测试工具)
2024-09-02 23:41:38
Selenium也是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。支持的浏览器包括IE(7、8、9)、Mozilla Firefox、Mozilla Suite等。这个工具的主要功能包括:测试与浏览器的兼容性——测试你的应用程序看是否能够很好得工作在不同浏览器和操作系统之上。测试系统功能——创建衰退测试检验软件功能和用户需求。支持自动录制动作和自动生成 .Net、Java、Perl等不同语言的测试脚本。Selenium 是ThoughtWorks专门为Web应用程序编写的一个验收测试工具。
1功能编辑
- 框架底层使用JavaScript模拟真实用户对浏览器进行操作。测试脚本执行时,浏览器自动按照脚本代码做出点击,输入,打开,验证等操作,就像真实用户所做的一样,从终端用户的角度测试应用程序。
- 使浏览器兼容性测试自动化成为可能,尽管在不同的浏览器上依然有细微的差别。
- 使用简单,可使用Java,Python等多种语言编写用例脚本。
2优势编辑
据 Selenium 主页所说,与其他测试工具相比,使用 Selenium 的最大好处是:
Selenium 测试直接在浏览器中运行,就像真实用户所做的一样。Selenium 测试可以在 Windows、Linux 和 Macintosh上的 Internet Explorer、Mozilla 和 Firefox 中运行。其他测试工具都不能覆盖如此多的平台。使用 Selenium 和在浏览器中运行测试还有很多其他好处。下面是主要的两大好处:
通过编写模仿用户操作的 Selenium 测试脚本,可以从终端用户的角度来测试应用程序。通过在不同浏览器中运行测试,更容易发现浏览器的不兼容性。Selenium 的核心,也称browser bot,是用 JavaScript 编写的。这使得测试脚本可以在受支持的浏览器中运行。browser bot 负责执行从测试脚本接收到的命令,测试脚本要么是用 HTML 的表布局编写的,要么是使用一种受支持的编程语言编写的。
Selenium 适用于以下浏览器:
Browser
|
Selenium IDE
|
Selenium Remote Control
|
Selenium Core
|
Selenium 2/Webdriver API
|
---|---|---|---|---|
Firefox 10
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 9
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 8
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 7
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 6
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 5
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 4
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 3.6
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
Run tests
|
Firefox 3
|
Record and playback tests
|
Start browser, run tests
|
Run tests
|
not supported
|
IE 9
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
IE 8
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
IE 7
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
Safari 3
|
not supported
|
Start browser, run tests
|
Run tests
|
not supported
|
Safari 2
|
not supported
|
Start browser, run tests
|
Run tests
|
not supported
|
Opera 9
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
Opera 8
|
not supported
|
Start browser, run tests
|
Run tests
|
Run tests
|
Chrome
|
not supported
|
Start browser, run tests***
|
Run tests***
|
Run tests***
|
Others
|
not supported
|
Partial support possible*
|
Run tests**
|
not supported
|
3组件编辑
- Selenium IDE:一个Firefox插件,可以录制用户的基本操作,生成测试用例。随后可以运行这些测试用例在浏览器里回放,可将测试用例转换为其他语言的自动化脚本。
- Selenium Remote Control (RC) :支持多种平台(Windows,Linux,Solaris)和多种浏览器(IE,Firefox,Opera,Safari),可以用多种语言(Java,Ruby,Python,Perl,PHP,C#)编写测试用例。
- Selenium Grid :允许Selenium-RC 针对规模庞大的测试案例集或者需要在不同环境中运行的测试案例集进行扩展。
4使用编辑
能把Selenium RC脚本和JUnit单元测试结合起来,既能涵盖功能测试,又能涵盖数据或后台Java类测试,从而构成一个完整的Web应用测试解决方案。
首先要安装JRE,从官网(文后参考资料)下载Selenium RC的程序Jar包,存放在硬盘的某个目录中,如E:/Selenium/ 。
启动Selenium RC服务,启动cmd模式,进入到selenium RC所在的目录后,输入: java -jar selenium-server.jar 。启动完成后,可以看到以下信息,即表示启动成功。
一个学习的网站
最新文章
- Base64 转换 %2B 变 空格 解决
- UIwebView 和 H5交互详情
- springmvc使用spring自带日期类型验证
- android webview如何加载asset目录里的页面
- TOAD FOR MYSQL 进行数据插入时乱码的解决办法---MariaDB 5.5
- NSBundle介绍及使用
- iOS中的几种定时器详解
- Java 中的泛型详解-Java编程思想
- 步步学LINQ to SQL:使用LINQ检索数据【转】
- HTML5 按字母顺序排列的标签列表 new : HTML5 中的新标签。
- iOS二维码条形码的制作
- ios逆向过程中lldb调试技巧
- DispatcherTimer和Timer(计时器)
- 备份的一些小tip
- Linux开机时停在 Starting sendmail 不动了的解决方案
- c++界面库方案
- 如何在Lua与C/C++之间实现table数据的交换
- C# 反射小结
- 更改Ubuntu默认python版本的两种方法python->; Anaconda
- mysql学习------二进制日志
热门文章
- Confluence 6 使用 LDAP 授权连接一个内部目录 - 服务器设置
- websphere设置企业应用使用的jvm最大最小内存
- President's Path CodeForces - 416E (最短路,计数)
- linux单用户模式
- OC 点语法和变量作用域
- [Leetcode] Unique binary search trees 唯一二叉搜索树
- bat批处理文件运行时隐藏cmd窗口
- poj 1163 The Triangle 搜索 难度:0
- POJ 2195 Going Home 最小费用流 难度:1
- trycatch之catch对捕获异常的处理及后续代码的执行的探索