没有合适的资源?快使用搜索试试~ 我知道了~
Selenium Documentation
5星 · 超过95%的资源 需积分: 14 78 下载量 149 浏览量
2011-08-18
13:57:00
上传
评论
收藏 2.97MB PDF 举报
温馨提示
试读
148页
在这段期间,我一直在找关于服务器的端测试方案,自动化工具等等,无意间我发现了Selenium 这个工具。在试 用一段时间后,觉得Selenium 确实是一个很不错的Web 测试工具。在和强大的QTP 比较后,我最后还是选择了使用 Selenium,主要的原因是工具使用灵活,简单,并且完全满足我的要求。而QTP 虽然强大,但它的使用让我觉得非常 繁琐,而调试功能也让我郁闷......鉴于种种这样的原因,我最后选择了Selenium。 本系列文章主要是总结我在前一段时间了解到的关于Selenium 的一些知识
资源推荐
资源详情
资源评论
Selenium Documentation
Release 1.0
Selenium Project
November 26, 2009
CONTENTS
1 Note to the Reader 3
2 Introducing Selenium 5
2.1 To Automate or Not to Automate? That is the Question! . . . . . . . . . . . . . . . . . 5
2.2 Test Automation for Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Introducing Selenium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Selenium Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Supported Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.6 Flexibility and Extensibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7 About this Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.8 The Documentation Team . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Selenium Basics 11
3.1 Getting Started – Choosing Your Selenium Tool . . . . . . . . . . . . . . . . . . . . . 11
3.2 Introducing Selenium Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 Test Suites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 Commonly Used Selenium Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Selenium-IDE 15
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Installing the IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 Opening the IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.4 IDE Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.5 Building Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.6 Running Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.7 Using Base URL to Run Test Cases in Different Domains . . . . . . . . . . . . . . . . 24
4.8 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.9 Writing a Test Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.10 User Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.11 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.12 Executing Selenium-IDE Tests on Different Browsers . . . . . . . . . . . . . . . . . . 29
4.13 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5 Selenese Selenium Commands 35
5.1 Verifying Page Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 Locating Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3 Matching Text Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
i
5.4 The “AndWait” Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.5 The waitFor Commands in AJAX applications . . . . . . . . . . . . . . . . . . . . . . 44
5.6 Sequence of Evaluation and Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.7 Store Commands and Selenium Variables . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.8 JavaScript and Selenese Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.9 echo - The Selenese Print Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.10 Alerts, Popups, and Multiple Windows . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6 Selenium-RC 49
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2 How Selenium-RC Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.4 From Selenese to a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.5 Programming Your Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.6 Learning the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.7 Reporting Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.8 Adding Some Spice to Your Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.9 Server Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.10 Specifying the Path to a Specific Browser . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.11 Selenium-RC Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.12 Handling HTTPS and Security Popups . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.13 Supporting Additional Browsers and Browser Configurations . . . . . . . . . . . . . . 78
6.14 Troubleshooting Common Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7 Test Design Considerations 85
7.1 Introducing Test Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.2 What to Test? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.3 Verifying Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.4 Choosing a Location Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.5 Testing Ajax Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.6 UI Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.7 Bitmap Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.8 Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8 Selenium-Grid 97
9 User-Extensions 99
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.2 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.3 Accessors/Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.4 Locator Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
9.5 Using User-Extensions With Selenium-IDE . . . . . . . . . . . . . . . . . . . . . . . . 101
9.6 Using User-Extensions With Selenium RC . . . . . . . . . . . . . . . . . . . . . . . . 101
10 .NET client driver configuration 105
11 Java Client Driver Configuration 109
11.1 Configuring Selenium-RC With Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . 109
11.2 Configuring Selenium-RC With Intellij . . . . . . . . . . . . . . . . . . . . . . . . . . 125
12 Python Client Driver Configuration 137
13 Locating Techniques 141
ii
剩余147页未读,继续阅读
pf20050904
- 粉丝: 19
- 资源: 28
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页