Function to display type ahead list in a dropdown

Share this post
FaceBook  Twitter  Mixx.mn     


To display content in Typeahead type of dropdowns, use following code
Steps:
1) Enter full text in Dropdown

2) Create a Shell Object

3) Send keys: END and then backspace

4) Typeahead value will be displayed from Dropdown

Code:

'Function to display type ahead list in a dropdown'
Function Type_Ahead(browser_name,page_name,object_name,ParamValue)
'1) Enter full text in Dropdown'
  Browser(browser_name).Page(page_name).WebEdit(object_name).Set ParamValue
     wait 1
  Browser(browser_name).Page(page_name).WebEdit(object_name).Click
 
'2) Create a Shell Object'  
    Set WshShell = CreateObject("WScript.Shell")
    
'3) Send keys: END and then backspace'    
    WshShell.SendKeys "{END}"    
    WshShell.SendKeys "{BACKSPACE}"    
    
'4) Typeahead value will be displayed from Dropdown'    
    Set WshShell= Nothing

End Function