vbs能不能定义结构体
对一个page对象中的几个element进行对应操作,我想用结构体完成,不知道可以不?比如:一个page中有edit,button,我想做个结构体,结构体包含了这两个对象,调用之后,分别对他们进行对应操作,是否可以,结构体如何定义,请高手指点! 希望对你有帮助。
Function gbExecuteData(oFrame)
objNames = DataManager.GetObjNames
Fori = 0 To Ubound(objNames)
sObjName =objNames(i)
sObjValue = DataManager.GetValue ( sObjName )
sObjType = DataManager.GetType( sObjName )
Select Case sObjType
Case "WebEdit" ' (WebEdit)
If Not oFrame.WebEdit(sObjName).Exist(HT) Then
Call ExcelReport("Warning", "gbExecuteData","Can't Find "&sObjName&" WebEdit ")
gbExecuteData = False
Else
oFrame.WebEdit(sObjName).Set sObjValue
Call ExcelReport("Pass","gbExecuteData","Set "&sObjName&" WebEdit "&sObjValue&" Succ!" )
End If
Case "WebButton"'WebButton
If Not oFrame.WebButton(sObjName).Exist(HT) Then
Call ExcelReport("Warning", "gbExecuteData","Can't Find "&sObjName&" WebButton ")
gbExecuteData = False
Else
oFrame.WebButton(sObjName).Click
Call ExcelReport("Pass","gbExecuteData","Click "&sObjName&" WebButton"&sObjValue&" Succ!" )
End If
Case Else
Call ExcelReport("Warning", "gbExecuteData","Object Type Error, Object Type "&sObjType&" not surpport yet")
End Select
Next
End Function 非常感谢,藏龙卧虎,你有没有qq号,或者加到我的群里:8080735
页:
[1]