Micro Focus QTP (UFT) Forums
web edit pull down - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: web edit pull down (/Thread-web-edit-pull-down)



web edit pull down - raphael - 11-15-2009

Does anybody know the script to select an item from a WEBEDIT pulldown?

Here is the scenario

enter name in webedit
Select first item from webedit pulldown.
then click submit button.

enter name in web edit
Select second from webedit pull down
then click submit button.

enter name in web edit
Select third from webedit down
then click submit button

total of twenty items

thank you!


RE: web edit pull down - venkatbatchu - 11-16-2009

Hi,

Please find the below test case to execute..
1.Launch the url as "http://www.google.co.in/"
2.Enter "venk" in webedit and select required one among the suggestion.
3.Hit Enter or click [Google search] button


Code:
Browser("xxxx").Page("xxxx").WebEdit("venk").Click
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "venk"
wait 3
WshShell.SendKeys "{DOWN}"  ' here i have selected first item  (if u want to select 3rd one use do while loop to select thte required one)
WshShell.SendKeys "{ENTER} "



please let me know if you need any information apart from this

Thanks,
Venkat.Batchu

With complete code:
Code:
Browser("Google").Page("Google").WebEdit("q").Click
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "venk"
wait 3
WshShell.SendKeys "{DOWN}" ' here i have selected first item (if u want to select 3rd one use do while loop to select thte required one)
WshShell.SendKeys "{ENTER} "