在QTP中获取未指定的错误

时间:2016-02-23 23:44:21

标签: vb.net vbscript automation automated-tests qtp

我尝试在QTP中执行以下脚本,该脚本在网页上打开F12开发人员选项,并通过验证网络数据网表来检查网络数据是否有404错误。但是我得到了一个" 未指定的错误"执行行

If trim(Browser("creationtime:=0").WinListView("regexpwndtitle:=Summary View ListView Control").GetSubItem(rcount,4))="404" then

请告诉我为什么会收到此错误。

Code:
Browser("creationtime:=0").highlight

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{F12}"
wait 20
Browser("creationtime:=0").WinListView("regexpwndtitle:=Summary View ListView Control").Click
wait 2
WshShell.SendKeys "{F5}"

Browser("creationtime:=0").Refresh
wait 20


 totalcount= Browser("creationtime:=0").WinListView("regexpwndtitle:=Summary View ListView Control").GetItemsCount


 For rcount = 1 to totalcount-1
     If trim(Browser("creationtime:=0").WinListView("regexpwndtitle:=Summary View ListView Control").GetSubItem(rcount,4))="404" then
        flag=true
        Exit for
     End if

 next

If flag Then
    msgbox "404 is present in row "&rcount
    else
    msgbox "404 is not present"
End If

0 个答案:

没有答案