To count the no of links present in the yahoo home page i
have written the script like this
Set fileSysObject=createobject("Scripting.FileSystemObject")
Set linksFileName=fileSysObject.opentextfile
("D:\samplelinkfile.txt",2,true)
Set linkDescObj=description.Create
linkDescObj("micclass").value="Link"
Set noOfLinks=browser("yahoo").Page("Yahoo!
India").ChildObjects(linkDescObj)

For i=0 to noOfLinks.count-1
linkName=noOfLinks(i).getROProperty("name")
linksFileName.writeline(linkName)
Next
linksFileName.close
Set fileSysObject=nothing

While running the script it showing error that
object "yahoo"isnot found in the object repository.
Is there any setting before running the script? if yes what
is the steps for it.Im using QTP9.0

Answers were Sorted based on User's Feedback



To count the no of links present in the yahoo home page i have written the script like this Set f..

Answer / baba

Hello buddy,

Do not bother about this type of small errors.

No need to open new test and record on yahoo page and again
pasting that code here in your code. all these long
process.ofcourse it may work. as a QTP profession you have
to go in efficient way.

Follow this steps.

Once you got that error message.

1. Just Open OR
2. Click on Add Objects button
3. Select your desired objects here (Links your case)
4. Click on Ok

go back to your test and run your test now.

if it not runs, delete your "browser("yahoo").page
("yahoo")... all these things

just add this code
systemutil.Run "www.yahoomail.com"
Set noOfLinks=browser("Yahoo! Mail: The best").Page("Yahoo!
Mail: The best").ChildObjects(linkDescObj)

it will work. no probs

All the best

Is This Answer Correct ?    3 Yes 0 No

To count the no of links present in the yahoo home page i have written the script like this Set f..

Answer / rico

Yes, this will give an error if you dont have the objects
(Browser and page) in the OR. So, here is what you can
do...open a new test and record any operaiton on yahoo page
and then later remove the steps generated in Expert view by
reocrding and later paste this code...i think this should
work

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More QTP Interview Questions

Can we Script any test case with out having Object repository? or Using Object Repository is a must

3 Answers   Crea,


Both static and dynamic arrays are handled by the vb script. Is it true?

0 Answers  


What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy paste the date from QTP help. I tryed it.But I don't Understand where should we use exactly.

5 Answers   Livetek,


How to launch application under test through VBscript without using systemutil.run or invokeapplication?

3 Answers  


What is DOM

2 Answers  






Explain how you can find length of array in qtp?

0 Answers  


what is compiled module?

1 Answers  


How to capture screen shots when an error occurs?

5 Answers   EDS,


Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?

0 Answers  


What is diffrence between Global variables and Environment variables...Anybody can give me answer..Thanks in advance..

3 Answers   IBM,


We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we handle this scenario in QTP?

5 Answers   Accenture, Banca Sella, Polaris,


Can anyone explain about Keyword driven framework in detail and how to use it in case of any project

4 Answers  


Categories