kpinnisetti
13 years agoContributor
ClickItem Not working
I have a script with this: Unable to find the object ClickItem("Admin"). How do I get TC 9 to recognize this control? I read the help topic. Thanks.
Sub FindDropDownListBox(propN, propValKey, strVal)
Dim browser
Dim page
Dim ddListBox
Set browser = Aliases.browser
Set page = browser.Page("*")
Set ddListBox = page.NativeWebObject.Find(propN,propValKey)
If ddListBox.Exists Then
Call ddListBox.focus()
diff = aqString.Find(ddListBox.wItemList, strVal, 0, false)
If diff <> -1 Then
ddListBox.ClickItem strVal
page.Wait 1
Else
Log.Error "Search Error: DropDown List '" & propValKey & "' searched by the property '" & propN & "' was find but Item '" & strVal & "' to select was not found."
End If
Else
Log.Error "Search Error: DropDown List '" & propValKey & "' searched by the property '" & propN & "' was not find."
End If
End Sub
Once you call this utility in you script or keyword tests, just provide it with the property name you want TC to search for and the value that distinguish this object from other ones among the mapped DropdownListBoxes...
Regards,
TedB