Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
city Autosuggest
#1
Solved: 11 Years, 3 Months, 2 Weeks ago
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
Reply
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
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
Reply
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
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


Reply
#4
Solved: 11 Years, 3 Months, 2 Weeks ago
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
Reply
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
hey
did u got my mail?
Reply
#6
Solved: 11 Years, 3 Months, 2 Weeks ago
Ya, it got ur mail...I had replied on it..plz check..
Reply
#7
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi sshukla
It will be helpful for others if u post the solution here in forum.
Reply
#8
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi,

Definitely..I will..Smile

Regards,
Sankalp
Reply
#9
Solved: 11 Years, 3 Months, 2 Weeks ago
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
Reply
#10
Solved: 11 Years, 3 Months, 2 Weeks ago
Hey thanks sankalp

this really helped me

Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)