Forum Discussion
I modified the code to fit into my script but still its not working..
The execution log says "ABC Select from Drop Down List" But in reality it does not click on it.
Please check the below code:
Sub test
Dim ObjName, propNames, propValues
ObjName, propNames, propValues
propNames = Array("ObjectType", "ObjectIdentifier")
propValues = Array("DropDownList","DropDownList591")
set ListObject=ObjName.FindChild(PropNames,PropValues, 9)
ListObject.Click
ItemText="ABC"
Set dataProvider=ListObject.FlexObject.dataProvider
log.Message dataProvider
log.Message dataProvider.length
found = False
For i = 0 To dataProvider.length
If dataProvider.source.item(i).name=ItemText Then
ItemIndexByText = i
log.Message ItemIndexByText
ListObject.FlexObject.ensureIndexIsVisible(ItemIndexByText)
delay 2000
found = True
Exit For
End If
Next
If Not found Then
Log.Error "DropDownList item """ & ItemText & """ was not found."
'Exit Sub
End If
Set app =ListObject.Parent
Do Until app.ObjectType ="Scroller"
Set app = app.Parent
Loop
' Find the list item object by text
propNames = Array("ObjectType", "ObjectIdentifier")
propValues = Array("DropDownList","DropDownList591")
Set item =app.FindChild(propNames, propValues, 4)
If item.Exists Then
item.Click
Log.message ItemText& "Select form Drop down list"
Else
Log.message ItemText& "Was not Select form Drop down list"
End If
end sub
Thanks,
Bindhu
Related Content
- 8 months agoMehwishDaud
- 5 years agom_essaid
- 5 years agokate123