(HP QuickTest)如何使用QuickTest获得HTTP状态?

(HP QuickTest)如何使用QuickTest获得HTTP状态?

问题描述:

我正在创建一个QuickTest脚本,该脚本获取页面的所有URL,并检查http请求的状态代码是否为200.但是我的问题是如何从URL获取http请求状态代码?

I'm creating an QuickTest script that get all URL's for a page and check if the status of http request where code is 200. But my question is how do I get the http request status code from a URL ?

这是我的解决方案:

Set Http = CreateObject("Microsoft.XMLHttp")
Set oDesc = Description.Create()
    oDesc("micclass").Value = "Link"
Set EditCollection = Browser("Browser").Page("Page").ChildObjects(oDesc)

URL_TEMP = EditCollection(i).GetROProperty("href")
Http.Open "GET" , URL_TEMP , false
Http.Send
msgbox Http.Status