Dim sElement As IHTMLElement
Dim i As Integer
Set hdoc = WebBrowser1.Document
Set eleColl = hdoc.all
For Each sElement In eleColl
If sElement.isTextEdit Then
If sElement.outerHTML = "" Then
sElement.setAttribute "value", "admin"
End If
If sElement.outerHTML = "" Then
sElement.setAttribute "value", "jetspeed"
End If
End If
Next
同理可以实现winrunner识别网页任何对象。
文章来源于领测软件测试网 https://www.ltesting.net/