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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

HI Everybody, I am using QTP 9.2, I have a problem and hope everybody help me solve it. Now I need to use mouse wheel event to zoom in or zoom out in web client, but QTP can't catch this event. I look forward helping of everybody. Thank you very much.

1630


Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.

1773


If I am scripting Web-based Surveys using QTP that open up differently but at the exact same point require a username and password can I automate that username and password for all the surveys some how using QTP?

1440


What is the default object synchronization timeout in qtp?

654


Have you used xml check point in your project?

558






Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1379


What is the difference between keyword view and expert view?

613


what is the structure for the data driven framework

1487


Hi, My name is kishan. I have good Conceptual Knowledge on QTP. In order to Boost up my Confidence Level, I want to do a Project oriented Training only on QTP in Hyderabad. Kindly Let me know which is the Best QTP Project Training Institute in Hyderabad. Thanks in Advance kishan

2062


How you are developing the script? Using record and play back or manual?

634


What is business process testing(bpt) in qtp?

697


HOw to add the recovery file at runtime to the test file .

1545


write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object.. (give a filter condition only WEbelement- not easy need to use some more property while giving filter condtions- use google for your help...))

1507


What are the differences between table and db checkpoints?

537


Which advantages helping QTP to hold the position of "Market Leader" for such a long period?

1391