liujia114207 发表于 2013-3-21 09:31:42

跪求结果,QTP用httpwatch组件获取页面状态,为什么返回的总是0

跪求结果,QTP用httpwatch组件获取页面状态,返回的总是0,明明想要的是200,哭了我。哪位大侠帮帮忙

Dim url,linkStatue
url="www.baidu.com"
Set control = CreateObject("HttpWatch.Controller")

Set plugin =control.IE.New()
plugin.log.EnableFilter(false)
plugin.Clear()
plugin.GotoURL(url)
wait 2
plugin.Record()
Browser("百度一下,你就知道").Page("百度一下,你就知道").Link("新 闻").Click
control.Wait plugin,-1
plugin.Stop

Set status= plugin.log.Entries.Item(0)
linkStatue =status.StatusCode
If 400>linkStatue Then
        Reporter.ReportEvent micPass,"返回码正确","返回码为"&linkStatue
        else
        Reporter.ReportEvent micFail,"返回码错误","返回码为"&linkStatue
End If

liujia114207 发表于 2013-3-25 16:22:42

跪求结果,QTP用httpwatch组件获取页面状态,返回的总是0,明明想要的是200,哭了我。哪位大侠帮帮忙Dim url,linkStatueurl="www.baidu.com"Set control = CreateObject("HttpWatch.Controller")Set plugin =control.IE.New()plugin.log.EnableFilter(false)plugin.Clear()plugin.GotoURL(url)wait 2plugin.Record()Browser("百度一下,你就知道").Page("百度一下,你就知道").Link("新 闻").Clickcontrol.Wait plugin,-1plugin.StopSet status= plugin.log.Entries.Item(0)linkStatue =status.Stat.
再顶一下,希望有高人指点
页: [1]
查看完整版本: 跪求结果,QTP用httpwatch组件获取页面状态,为什么返回的总是0