WinRunner 7.0 使用说明(中文版)
第一版
WOZA
Email: lidaren@hotmail.com
第 1 页 共 127 页
目录
1. 简介....................................................................................................................................................... 6
1.1 WinRunner 测试模式 ................................................................................................................... 6
1.2 WinRunner 测试过程 ................................................................................................................... 7
1.3 样本软件....................................................................................................................................... 9
1.4 使用 TestSuite(测试套件) .......................................................................................................... 10
2. WinRunner 使用概述.......................................................................................................................... 11
2.1 启动 WinRunner ......................................................................................................................... 11
2.2 WinRunner 主窗口 ..................................................................................................................... 12
2.3 测试窗口..................................................................................................................................... 13
2.4 加载 WinRunner 插件 ............................................................................................................... 14
3. WinRunner 如何识别 GUI 对象......................................................................................................... 15
3.1 关于识别 GUI 对象.................................................................................................................... 15
3.2 测试中如何识别 GUI 对象........................................................................................................16
3.3 物理描述(Physical Description)............................................................................................ 17
3.4 逻辑名(Logic Names) ........................................................................................................... 18
3.5 GUI map...................................................................................................................................... 19
3.6 设定窗体环境(Window Context).......................................................................................... 20
4. 理解 GUI map ..................................................................................................................................... 21
4.1 关于 GUI map............................................................................................................................. 21
4.2 查看 GUI 对象属性.................................................................................................................... 22
4.3 教 WinRunner 被测软件的 GUI ................................................................................................ 26
4.4 在 GUI map 中找到对象或窗体................................................................................................ 27
4.5 GUI map files 使用概要 ............................................................................................................. 28
4.6 GUI map file 模式的选取 .......................................................................................................... 29
5. Global GUI Map File(共用 GUI 地图文件)模式的使用.............................................................. 30
5.1 关于 Global GUI Map File 模式 ................................................................................................ 30
5.2 测试中共享 GUI Map File ......................................................................................................... 31
5.3 让 WinRunner 学习 GUI ............................................................................................................ 32
5.4 保存 GUI Map ............................................................................................................................ 38
第 2 页 共 127 页
5.5 加载 GUI Map 文件 ................................................................................................................... 40
5.6 Global GUI Map File 模式要点 ................................................................................................. 42
6. GUI Map File per Test 模式的使用.................................................................................................... 43
6.1 关于 GUI Map File per Test 模式............................................................................................... 43
6.2 GUI Map File per Test 模式下工作............................................................................................ 45
6.3 GUI Map File per Test 模式要点................................................................................................ 46
7. 编辑 GUI Map..................................................................................................................................... 47
7.1 关于编辑 GUI Map .................................................................................................................... 47
7.2 运行巫师(Run Wizard).......................................................................................................... 48
7.3 GUI Map 编辑器 ....................................................................................................................... 50
7.4 修改逻辑名和物理描述............................................................................................................. 52
7.5 WinRunner 处理可变的窗体卷标 ............................................................................................. 53
7.6 在物理描述中使用常规表达式................................................................................................. 55
7.7 在文件间复制和移动对象......................................................................................................... 56
7.8 在 GUI Map File 里找到对象 .................................................................................................... 58
7.9 在多个 GUI Map File 里找到对象 ............................................................................................ 59
7.10 在 GUI Map File 里手工添加对象 ............................................................................................ 60
7.11 从 GUI Map File 里删除对象 .................................................................................................... 61
7.12 清除 GUI Map File ..................................................................................................................... 62
7.13 筛选显示对象............................................................................................................................. 63
7.14 保存 GUI Map 的变更 ............................................................................................................... 64
8. 合并 GUI Map File .............................................................................................................................65
8.1 关于合并 GUI Map File ............................................................................................................. 65
8.2 合并 GUI Map File 的准备 ........................................................................................................ 66
8.3 解决自动合并 GUI Map 文件的冲突 ....................................................................................... 68
8.4 手工合并 GUI Map 文件 ........................................................................................................... 70
8.5 改变到 Global GUI Map File 模式 ............................................................................................ 72
9. 配置 GUI Map..................................................................................................................................... 73
9.1 关于配置 GUI Map .................................................................................................................... 73
9.2 理解 GUI Map 的默认配置 ....................................................................................................... 74
9.3 把自定义对象映射到标准的类................................................................................................. 75
9.4 配置标准或自定义的类............................................................................................................. 77
第 3 页 共 127 页
9.5 创建永久的 GUI Map 配置 ....................................................................................................... 81
9.6 删除自定义的类......................................................................................................................... 82
9.7 类属性......................................................................................................................................... 83
9.8 所有属性..................................................................................................................................... 84
9.9 默认学习属性............................................................................................................................. 87
9.10 Visual Basic 对象的属性............................................................................................................ 88
9.11 PowerBuilder 对象的属性.......................................................................................................... 89
10. 学习虚拟对象..................................................................................................................................... 90
10.1 关于学习虚拟对象..................................................................................................................... 90
10.2 定义一个虚拟对象..................................................................................................................... 91
10.3 理解虚拟对象的物理描述......................................................................................................... 94
11. 创建测试............................................................................................................................................. 95
11.1 关于创建测试............................................................................................................................. 95
11.2 解决常见的环境感应录制问题................................................................................................. 96
11.3 模拟录制..................................................................................................................................... 97
11.4 检查点......................................................................................................................................... 98
11.5 数据驱动测试............................................................................................................................. 99
11.6 同步点....................................................................................................................................... 100
11.7 计划一个测试........................................................................................................................... 101
11.8 测试信息文档化....................................................................................................................... 102
11.9 测试相关插件........................................................................................................................... 104
11.10 录制测试........................................................................................................................... 105
11.11 用热键激活测试创建命令............................................................................................... 106
11.12 测试编程........................................................................................................................... 108
11.13 编辑测试........................................................................................................................... 109
12. 检查 GUI 对象.................................................................................................................................. 110
12.1 关于检查 GUI 对象.................................................................................................................. 110
12.2 检查单个属性的值................................................................................................................... 111
12.3 检查单个对象........................................................................................................................... 112
12.4 检查一个窗体中的多个对象................................................................................................... 114
12.5 检查一个窗体中的所有对象................................................................................................... 115
12.6 理解 GUI 检查点语句.............................................................................................................. 116
第 4 页 共 127 页
12.7 在 GUI 检查点中使用已存在的 GUI 检查清单..................................................................... 117
12.8 修改 GUI 检查清单.................................................................................................................. 118
12.9 理解 GUI 检查点对话框.......................................................................................................... 119
12.10 属性检查和默认检查....................................................................................................... 120
12.11 为属性检查指定变量....................................................................................................... 123
12.12 编辑属性期望值............................................................................................................... 126
12.13 修改 GUI 检查点的期望结果.......................................................................................... 127
第 5 页 共 127 页