List的属性是WebElement的时候使用Document来选择list里面的值
'------------------------------------------------------------------------------------------------------------------------
'Function OBJ_Select_WebElement
'Description Get Object & Select value from WebElement
'Input SelectValue
'Output Select object value result
'------------------------------------------------------------------------------------------------------------------------
Function OBJ_Select_WebElement(Parameter,Object)
On Error Resume Next
Err.Clear
If OBJ_Find(Object) = False Then
OBJ_Select_WebElement = "Error|"&FormatCurrentTime() & " Cannot find object. Error Details: " & Err.Description & ".|"
Exit Function
End If
selectValue = GetPropertyValue("SelectValue",Parameter)
If GetPropertyValue("SelectItem",Parameter) <> Empty Then
item = GetPropertyValue("SelectItem",Parameter)
item = ParsePropertyValue(item)
count_n = Cint(item)
Else
listCount = Cint(Action_Object.Object.all.length-1)
For i = 0 to listCount-1
If Action_Object.Object.all(i).innerText = selectValue Then
count_n = i
Exit For
End If
Next
End If
If count_n <> 0 Then
Action_Object.Object.all(Cint(count_n)).Click
Else
OBJ_Select_WebElement = "Error|" & FormatCurrentTime() & " Select value failed. Cannot find the value for the object.|"
End If
Err.Clear
If Err.Number = 0 Then
OBJ_Select_WebElement = "Pass|" & FormatCurrentTime() & " Select value successfully.|"
Else
OBJ_Select_WebElement = "Error|" & FormatCurrentTime() & " Select value failed. Error Number :"&Err.Number & " Error Description :" & Err.Description&"|"
End If
End Function