Micro Focus QTP (UFT) Forums
Auto suggest WebEdit - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Auto suggest WebEdit (/Thread-Auto-suggest-WebEdit)



Auto suggest WebEdit - Harsha - 05-18-2014

Hi all,
I am working on google search auto suggest webedit. I am able to display the auto suggest drop down but not able to select a particular item from the drop down. I used "Wscript.Shell" concept and sendkeys. But, it is not selecting any of the item.
SystemUtil.Run "iexplore.exe","https://www.google.co.in/"

Code:
Browser("title:=Google.*").Page("title:=Google.*").WebEdit("name:=q").Set "a"

wait(2)

Browser("title:=Google.*").Page("title:=Google.*").WebEdit("name:=q").fireevent "onkeydown"

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "{ENTER}"
set WshShell = nothing