Micro Focus QTP (UFT) Forums

Full Version: web edit pull down
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
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} "