(HP QuickTest) How do I get HTTP status using Quic

2019-07-03 21:44发布

问题:

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 ?

回答1:

This was my solution:

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