|
|
| |
| 开发人员用的提交测试环境的AutoIT脚本
|
| |
| |
| |
主要功能就是依次检查各个步骤,确定该做的工作都已经完成,如果没有完成,就自动打开相关的工具,并等待完成。
代码如下:
002 |
$vss = "C:\Program
Files\Microsoft Visual Studio\COMMON\VSS\win32\SSEXP.EXE" |
003 |
$ie = "C:\Program
Files\Internet Explorer\iexplore.EXE" |
004 |
$plsql = "C:\Program
Files\PLSQL Developer\plsqldev.exe" |
007 |
$haveCheckedIn = MsgBox(4,
"VSS 检查","是否已经将所有文件提交VSS?")
|
008 |
;->否;打开VSS,自动输入用户名密码,进入
|
009 |
If $haveCheckedIn
= 7 Then |
012 |
WinWaitActive("Visual
SourceSafe Login") |
016 |
WinWaitActive("Visual
SourceSafe Explorer -- vss60cn");
|
019 |
MsgBox(0,"VSS
检查","完成之后请继续!")
|
021 |
If
WinExists("Visual SourceSafe
Explorer -- vss60cn") Then |
022 |
WinClose("Visual
SourceSafe Explorer -- vss60cn")
|
023 |
WinWaitClose("Visual
SourceSafe Explorer -- vss60cn")
|
029 |
$haveSQLFiles = MsgBox(4,
"SQL 检查","是否有需要提交的SQL文件?");
|
031 |
;如果有SQL的话,则需要验证SQL的有效性
|
032 |
if $haveSQLFiles = 6 Then |
034 |
$CheckedSQL
= MsgBox(4,"SQL 检查","是否已经验证过SQL的有效性?")
|
035 |
;->否:打开pl/sql
developer,并以sys身份登录 |
036 |
if
$CheckedSQL = 7 Then |
039 |
WinWaitActive("Oracle
Logon") |
050 |
WinWaitActive("PL/SQL
Developer - sys@ORCL_139") |
053 |
MsgBox(0,"SQL
检查","完成之后请继续!")
|
055 |
If
WinExists("PL/SQL Developer
- sys@ORCL_139") Then |
056 |
WinClose("PL/SQL
Developer - sys@ORCL_139") |
057 |
WinWaitClose("PL/SQL
Developer - sys@ORCL_139") |
063 |
$ModifiedQC = MsgBox(4,"QC
检查","是否已经修改QC状态?")
|
065 |
If $ModifiedQC
= 7 Then |
072 |
WinWaitActive("Mercury
Quality Center 9.0 - Windows Internet Explorer")
|
075 |
MsgBox(0,"QC
检查","完成之后请继续!")
|
077 |
If
WinExists("Mercury Quality
Center 9.0 - Windows Internet Explorer")
Then |
078 |
WinClose("Mercury
Quality Center 9.0 - Windows Internet Explorer")
|
079 |
WinWaitClose("Mercury
Quality Center 9.0 - Windows Internet Explorer")
|
084 |
$haveFilledChangeReport
= MsgBox(4, "变更登记检查","是否已填写变更登记并签入?")
|
085 |
;->否;打开VSS,自动输入用户名密码,进入
|
086 |
If $haveFilledChangeReport
= 7 Then |
089 |
WinWaitActive("Visual
SourceSafe Login") |
093 |
WinWaitActive("Visual
SourceSafe Explorer -- vss60cn");
|
096 |
MsgBox(0,"变更登记检查","完成之后请继续!")
|
098 |
If
WinExists("Visual SourceSafe
Explorer -- vss60cn") Then |
099 |
WinClose("Visual
SourceSafe Explorer -- vss60cn")
|
100 |
WinWaitClose("Visual
SourceSafe Explorer -- vss60cn")
|
106 |
$havePrintedTestReport
= MsgBox(4, "测试报告检查","是否已填写IT测试报告?")
|
108 |
If $havePrintedTestReport
= 7 Then |
114 |
$ProgramType
= MsgBox(4, "测试报告检查","请选择提交程序的类型:需求选是,Bug选否!")
|
117 |
If
$ProgramType = 6 Then |
118 |
Send("WINWORD.EXE
C:\IT测试报告_rq.doc", 1) |
122 |
If
$ProgramType = 7 Then |
123 |
Send("WINWORD.EXE
C:\IT测试报告_rq.doc", 1) |
128 |
MsgBox(0,"变更登记检查","完成之后请继续!")
|
130 |
If
WinExists("IT测试报告_rq.doc
- Microsoft Word") Then |
131 |
WinClose("IT测试报告_rq.doc
- Microsoft Word") |
132 |
WinWaitClose("IT测试报告_rq.doc
- Microsoft Word") |
135 |
If
WinExists("IT测试报告_ing.doc
- Microsoft Word") Then |
136 |
WinClose("IT测试报告_ing.doc
- Microsoft Word") |
137 |
WinWaitClose("IT测试报告_ing.doc
- Microsoft Word") |
143 |
MsgBox(0,"恭喜","一切OK,测试报告签字后就可以提交了!") |
这样,就可以避免在发布测试环境的时候忘东忘西了,呵呵。
其实,还可以进行其他改进,比方说:
构建几个函数,让程序模块化。
使用鼠标控制事件,让自动化的程度更高。
希望大家也能够使用AotuIT这个工具,让我们日常的重复性工作的自动化程度更高。 |
|
|