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 |
How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?
How many ways we can parameterize data in QTP ?
How can we get the result from WindowsXP Command Window? (e.g. After we input 'ipconfig' in command window, how QTP get the result?)
How to create an instance in QTP?
Out of 3 recording modes. 1.Standard 2.Analog 3.Low-level, which one is commonly used. As per my knowledge, Analog is used for Graphs , barcoding or DIgital signatures.
Explain how you can find length of array in qtp?
DIFFERENCE BETWEEN WR 8.2 & QTP 8.2? HOW TO INTEGRATE WITH SOME OTHER TOOLS?
Create an Excel file and pass the values from Flat File? (for ex:data1.txt,data2.txt )
How to get Traceability matrix from TD?
where u maintain qtp scripts in ur company
list me out the shortcutkeys for some functionlities in the qtp for example to record ,to run ... etc
why we use environment variables