大家好,又见面了,我是你们的朋友全栈君。
分类: 自动化 2015-07-13 23:48 49人阅读 评论(0) 收藏 举报
On Error Resume Next REM Msgbox(Err.Number) REM Msgbox(Err.Source) REM Msgbox(Err.Description)
REM ############################################################################## SystemUtil.Run “C:\Program Files (x86)\Internet Explorer\iexplore.exe”,””,”%HOMEDRIVE%%HOMEPATH%”,”” Browser(“百度一下,你就知道”).Page(“百度一下,你就知道”).Sync Browser(“百度一下,你就知道”).Navigate “http://www.baidu.com/“ Browser(“百度一下,你就知道”).Page(“百度一下,你就知道_2”).WebEdit(“wd”).Set “UFT”
REM #点击按钮前,先检查对象存在性 Browser(“百度一下,你就知道”).Page(“百度一下,你就知道_2”).WebButton(“百度一下1”).Check CheckPoint(“百度一下”) If instr(Err.Description, “WebButton”) > 0 Then msgbox(“按钮不存在”) Else Browser(“百度一下,你就知道”).Page(“百度一下,你就知道_2”).WebButton(“百度一下”).Click End If
———
REM #等待搜索结果&点击链接 wait(1) Browser(“百度一下,你就知道”).Page(“UFT_百度搜索#wd=UFT&rsv_spt=1&issp”).Link(“UFT/QTP11.5新特性 – TIB -“).Click msgbox(Actionname)
REM #网页是否存在 Browser(“UFT/QTP11.5新特性 – TIB -“).Page(“UFT/QTP11.5新特性 – TIB -“).Sync If Err.Number<>0 Then Browser(“百度一下,你就知道”).Page(“百度一下,你就知道_2”).WebEdit(“wd”).Check CheckPoint(“查询结果Link page未打开”) End If
Msgbox(Err.Description) Browser(“UFT/QTP11.5新特性 – TIB -“).CloseAllTabs Browser(“百度一下,你就知道”).Page(“UFT_百度搜索#wd=UFT&rsv_spt=1&issp”).Sync Browser(“百度一下,你就知道”).CloseAllTabs
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/140269.html原文链接:https://javaforall.cn