QTP:获取对话框中内容并写入到EXCEL中
上一篇 /
下一篇 2011-05-30 10:36:16
/ 个人分类:qtp
' =======================================================================================================================
'点报价后,如果存在对话框,才执行then后的语句(程序健壮性处理,防止,点报价没有弹出对话框的情况出现)--renquande 2011-4-19
' =======================================================================================================================
If Browser("人保财险营销平台").Dialog("Microsoft Internet Explorer").Exist Then
info=Browser("人保财险营销平台").Dialog("Microsoft Internet Explorer").WinButton("确定").GetROProperty("attached text")'把弹出提示框上的确定按钮添加到对象库,确定按钮attached text属性值,就是static中提示信息的内容,使用GetROProperty方法获取脚本运行时attached text的属性值
H=DataTable.GetSheet("jieguo").GetRowCount'获取总共有多少行数据,test是sheet页的名字
DataTable.SetCurrentRow(H+1)'获取行,即使该行为焦点
DataTable.value("实际结果","jieguo")=info '给该行赋值 ,test和上面一样,是写入的sheet页的名字,tishi是 该sheet页中存在的一个列名
'error_message = Browser("登录页").Dialog("Microsoft Internet Explorer").GetVisibleText
'msgbox (info)
wait 2
Browser("人保财险营销平台").Dialog("Microsoft Internet Explorer").WinButton("确定").Click
Browser("人保财险营销平台").Dialog("Microsoft Internet Explorer").WinButton("确定").Click
else
' info1=Browser("人保财险营销平台").Dialog("Microsoft Internet Explorer").WinButton("确定").GetROProperty("attached text")'把弹出提示框上的确定按钮添加到对象库,确定按钮attached text属性值,就是static中提示信息的内容,使用GetROProperty方法获取脚本运行时attached text的属性值
H=DataTable.GetSheet("jieguo").GetRowCount'获取总共有多少行数据,test是sheet页的名字
DataTable.SetCurrentRow(H+1)'获取行,即使该行为焦点
'=======================================================================================================================
'给该行赋值 ,test和上面一样,是写入的sheet页的名字,tishi是 该sheet页中存在的一个列名
' =======================================================================================================================
DataTable.value("实际结果","jieguo")= "没有管控"
Reporter.ReportEvent micFail,"Failed","error dialog don't show!"
End If
'Browser("人保财险营销平台").Close
End If
收藏
举报
TAG: