Micro Focus QTP (UFT) Forums
city Autosuggest - 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: city Autosuggest (/Thread-city-Autosuggest)

Pages: 1 2


city Autosuggest - sia sharma - 06-19-2012

hi all,

i m testing a website...
it has a textbox which allows user to select a city from auto suggest list..
when i m recording a script in qtp ..it is not capaturing the autosuggest ...
how can i make qtp work for the same..

Thanks
sia


RE: city Autosuggest - sshukla12 - 06-19-2012

Hi,
Use the below code for reference, it might help u

Code:
Set WshShell = CreateObject("WScript.Shell")
wait (1)
WshShell.SendKeys "te"
wait(1)
Set WshShell = Nothing
wait 4
Browser("").Page("").Frame("").WebElement("innertext:=test","index:=1").Click


Regards,
Sankalp


RE: city Autosuggest - sia sharma - 06-20-2012

hey

thanks for the code Sankalp
i tried to run this code but it is not working
this code is for what purpose?
my main purpose is to check whether auto suggest appears on webpage

i m trying to attach screenshot..but there some problem with add attachment ... Sad





RE: city Autosuggest - sshukla12 - 06-20-2012

Hi, this code is to check and select the item from auto suggest list.
First set the focus on txtBox
Then wsShell will write the text (in this case it is te, specify the text as per ur requirement)
wait xx-- time to display the auto suggest list
Add the auto suggest to OR..in my case it was web element
Then select the choice.

Regards,
Sankalp


RE: city Autosuggest - sia sharma - 06-21-2012

hey
did u got my mail?



RE: city Autosuggest - sshukla12 - 06-21-2012

Ya, it got ur mail...I had replied on it..plz check..


RE: city Autosuggest - ssvali - 06-21-2012

Hi sshukla
It will be helpful for others if u post the solution here in forum.


RE: city Autosuggest - sshukla12 - 06-21-2012

Hi,

Definitely..I will..Smile

Regards,
Sankalp


RE: city Autosuggest - sshukla12 - 06-22-2012

Hi,

Please find the below code. It worked for me, hope same 4 u 2 Smile

'Comment: Add the txtBox city in OR and go for fire eventon click which will display the auto suggest list
Code:
Browser("abc").Page("xyz").WebEdit("qwe").FireEvent "onclick"
Set WshShell = CreateObject("WScript.Shell")

wait (1)
'Comment:Enter the initialsfor the city like for Mumbaiwrite mum, for kanpur write Kan
Code:
WshShell.SendKeys "Nag"


Code:
wait(1)
Set WshShell = Nothing
wait 4
'Comment: Pass the complete nameof city under Text
Browser("abc").Page("xyz").Link("html tag:=A","text:=Nagpur","index:=0").Click

Let me know in case of any help required.

Regards,
Sankalp


RE: city Autosuggest - sia sharma - 06-22-2012

Hey thanks sankalp

this really helped me

Smile