TA的每日心情 | 无聊 2018-9-27 10:05 |
---|
签到天数: 36 天 连续签到: 1 天 [LV.5]测试团长
|
回复 1# user603
问题一:以前收集了一个这样的函数- '=========================================================
- ' Name: CheckAllLinkReachable
- ' Summary: CheckAllLinkReachable
- ' Parameters:
- ' strBrowser: browser name
- ' strPage: page name
- ' strURLPattern: URL pattern you wan't to check. such as: ^http.*
- ' Return: None
- '==========================================================
- Function CheckAllLinkReachable(strBrowser, strPage, strURLPattern)
- Dim blnReachable
- blnReachable = True
- Set objXML = CreateObject("Msxml2.XMLHTTP")
-
- ' Get all link on the page
- Set objDes = Description.Create
- objDes("micclass").Value = "Link"
- Set objLinkList = Browser(strBrowser).Page(strPage).ChildObjects(objDes)
- For i = 0 To objLinkList.Count() - 1
- ' Create XML HTTP Object
- strURL = objLinkList(i).GetROProperty("href")
- If RegExpTest(strURLPattern, strURL) Then
- objXML.Open "POST", strURL, false
- objXML.Send
- ' msgbox objXML.responseText
- print (objLinkList(i).GetROProperty("href") & " Ready State:" & objXML.readyState & " Status: " & objXML.status)
- If objXML.status <> "200" Then
- blnReachable = False
- End If
-
- objXML.abort()
- End If
- Next
-
- Set objXML = Nothing
- CheckAllLinkReachable = blnReachable
- End Function
复制代码
问题二:我觉得应该是可以的,但我vbs玩的没那么深
我的做法是写成个Function,在Function里将地址拆解一下,然后逐个调用个判断是否存在这样目录的Function,如果没有就调用个创建目录的Function。 |
|