这篇文章讲解如何使用TestComplete运行一个记事本,输入内容后保存,通过这个实例熟悉TestComplete的环境,了解windows的GUI的测试基本流程。
整个文档的步骤:
1. 创建projectsuite;
2. 创建project;
3. 加入TestApps;
4. 编写启动被测程序部分脚本;
5. 录制脚本;
6. 回放;
咱的目的就是直奔主体,不讲那么多的为什么,只讲是什么,让人可以最短的时间感性体会到TestComplete做一个GUI自动化测试的流程,LET’S GO!
1. 创建projectsuite;
http://hi.csdn.net/attachment/201108/12/0_13131637340bFV.gif
http://hi.csdn.net/attachment/201108/12/0_13131637410dsl.gif
2. 创建project;
这里可以创建多个项目,以后方便多人共同使用
http://hi.csdn.net/attachment/201108/12/0_13131637687NVU.gif
http://hi.csdn.net/attachment/201108/12/0_13131637729txi.gif
3. 加入TestApps;
http://hi.csdn.net/attachment/201108/12/0_13131638222452.gif
http://hi.csdn.net/attachment/201108/12/0_13131638272SRw.gif
http://hi.csdn.net/attachment/201108/12/0_1313163839KkOf.gif
http://hi.csdn.net/attachment/201108/12/0_1313163843l45L.gif
4. 编写启动被测程序部分脚本;
dim p1
'1. 启动 notepad,这段是人工编的
TestedApps.NOTEPAD.Run
Set p1 = Sys.WaitProcess(“NOTEPAD”, 5000)
If (Not p1.Exists) Then
call Log.Error(“The ““Notepad”” process was not found.”, _
“Make sure the path was specified correctly in the list of tested applications.”)
Exit Sub
End If
5. 录制脚本;
http://hi.csdn.net/attachment/201108/12/0_1313164018pAo1.gif
6. 回放;
开始录制:
http://hi.csdn.net/attachment/201108/12/0_13131640510qfw.gif
添加说明:
http://hi.csdn.net/attachment/201108/12/0_1313164103ko2g.gif
终止录制:
http://hi.csdn.net/attachment/201108/12/0_1313164130H6bR.gif
生成映射名称:
http://hi.csdn.net/attachment/201108/12/0_1313164164n828.gif
查看回放日志:
http://hi.csdn.net/attachment/201108/12/0_1313164184pRNP.gif
做WEB自动化测试也是一样的流程,只不过把被测程序更换为
C:\Program Files\Internet Explorer\iexplore.exe,然后参数设置为需要打开的主页:http://xxx
http://hi.csdn.net/attachment/201108/12/0_1313164240IwIJ.gif