Micro Focus QTP (UFT) Forums
How to fetch the valid suggestions in to variables - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: How to fetch the valid suggestions in to variables (/Thread-How-to-fetch-the-valid-suggestions-in-to-variables)



How to fetch the valid suggestions in to variables - venkatbatchu - 07-30-2009

Hi All,
Please observe the attached document.

1. I need to capture these valid suggestions in to variables, please explain on this.
2. Need to capture this number of results also (Ex: 12345789 results)

Thanks,
Venkat.Batchu


RE: How to fetch the valid suggestions in to variables - Saket - 07-30-2009

This is quite interesting for me, I am trying to achive the required.
I am able to get the Suggestion labels only not the results count.
I have done this with very easy method, see if this helps you in any way.

Code:
Browser("Google").Page("Google").WebEdit("q").Click
set WshShell = CreateObject("WScript.Shell")

WshShell.SendKeys "s"
wait 3
WshShell.SendKeys "{DOWN}"

sFirstSuggestion = Browser("Google").Page("Google").WebEdit("q").GetROProperty("value")
Print sFirstSuggestion

Do until sSugg = sFirstSuggestion
    'wait 3
    WshShell.SendKeys "{DOWN}"
    sSugg = Browser("Google").Page("Google").WebEdit("q").GetROProperty("value")
    Print sSugg
    
Loop