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
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 |
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 |
What is Cross browser testing? Does UFT support it?
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
0 Answers Tavant Technologies,
how to automate standalone infopath forms using QTP? (it is not a dotnet or a web form)
What is object repository in qtp?
What is the difference between Functions and Action ?
The Senario is Steps to do 1.Entered userid in textbox 2.saved with details 3.i want to open user which i have created its in hurry.....
hello, i just started searching for a job on QA ,need QTP software full version.plz can any body help me...my email id is padma_ub@yahoo.com.thanks in advance.
How to load the object repository at run time?
What is an other way of "Wait" statement in QTP I dont want to use wait("Some number"). Can any one tell this please..........
hi is there any chance to change encoding the password
Hi, How to give drop down values as input [Variable] from data table in QTP? If u know share with me.
How can i use Output Check points in QTP