0 环境
1 操作
1.1 前言
与异常遍历结合 需要表格记录下来(读写) 代码大概跑了一下 若细节有错 请自行更改
1.2 导出
systemutil.Run "D:Program Files (x86)HPQuickTest Professionalsamplesflightappflight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set datatable("username",dtlocalsheet)
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").Set datatable("password",dtlocalsheet)
Dialog("Login").WinButton("OK").Click
If dialog("Login").Dialog("Flight Reservations").Exist Then
warning = dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").GetROProperty("text")
datatable("warnning",dtlocalsheet) = warning
reporter.ReportEvent micPass,"对话提示框,验证异常","通过 显示:" &warning
dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
else
reporter.ReportEvent micFail,"对话提示框,验证异常","未通过"
End If
dialog("Login").WinButton("Cancel").Click
datatable.Export("e:/111/info.xls")
1.3 导入导出(读取值修改后再保存)
systemutil.Run "D:Program Files (x86)HPQuickTest Professionalsamplesflightappflight4a.exe"
datatable.Import("e:/111/info.xls")
Dialog("Login").WinEdit("Agent Name:").Set datatable("username",dtlocalsheet)
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").Set datatable("password",dtlocalsheet)
dialog("Login").WinButton("OK").Click
If dialog("Login").Dialog("Flight Reservations").Exist Then
actul = dialog("Login").Dialog("Flight Reservations").Static("Incorrect password. Please").GetROProperty("text")
'msgbox actul
datatable("actul",dtlocalsheet) = actul
warning = datatable("warnning",dtlocalsheet)
'msgbox warning
If warning = actul Then
'reporter.ReportEvent micPass,"对话异常提示框","通过 显示:"&actul
datatable("result",dtlocalsheet) = "pass"
else
datatable("result",dtlocalsheet) = "fail"
'reporter.ReportEvent micFail,"对话异常提示框","不通过"
End If
dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click
End If
dialog("Login").WinButton("Cancel").Click
datatable.Export("e:/111/info.xls")
设置一下遍历所有行和全局运行exe环境
表格的导入
首先添加好登录和异常弹出框相关的控件
利用小飞机 获static文本的异常值 保存位置表格actul字段
判断表格内的warnning的值与实际actul的值是否一致
一致 表格result写入pass
否则 表格result写入fail
逐层关闭弹出框
表格的导出