Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spying Autofill in google
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Good Afternoon,

I am running some basic web scripts at the moment. I want my script to retrieve some words from an excel file and post it in google search . And click on submit.

I am using descriptive programming and am unable to find out the class name for the autofill box that appears as soon as we begin typing in it.

Thank you so much

Soumya
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
I used Object Spy and can see the properties as below -

class - WebEdit
name - q

Please post a screen shot of the auto fill box if you are still not able to get it.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi prasant,

I typed a basic script of 2 lines
Code:
browser("name:=Google").page("title:=Google").webedit("name:=q").Set "qtp"
browser("name:=Google").page("title:=Google").webbutton("name:=Google Search", "value:=Google Search").Click

The first statement is executed, the text 'qtp' is inserted into the text box.
The second statement is not executed and the following error is displayed.
The "[ WebButton ]" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object.

Thank you so much for your time.

Soumya
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Soumya,

The error message itself tells about the problem.
QTP finds more than one object with the description properties given by you and unable to recognize object.

You need to use ordinal identifier in this case.

Use below code, it should work -

Code:
browser("name:=Google").page("title:=Google").webbutton("name:=Google Search", "index:=0").Click
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
I used this code and it worked (I am using QTP-11, in QTP 9.2 also it worked)

Code:
Browser("title:=Google").page("title:=Google").WebEdit("name:=q").Set DataTable.Value("SearchID")
Browser("title:=Google").page("title:=Google").WebButton("name:=Google Search").Click
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to select value from google search box dropdown +QTP prajyot 0 2,902 06-28-2017, 06:30 PM
Last Post: prajyot
  need vbscript to search for a "text string" on a google search page ? vimal singh 1 7,843 07-16-2010, 09:40 AM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)