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 |
WHO TAKE DECISION TO RELEASE THE BUILD
Hi, I got error message as "object does not support this property or method: "Test.Actions" when i execute the following line of script on QTP 9.0 Dim qtApp, qtRep Set qtApp = CreateObject("QuickTest.Application") Set qtRep = qtApp.Test.Actions("Action1").ObjectRepositories Can anyone tell me where i am wrong.
how can we group that these test cases only should be automated and in which order you execute that test cases?
list me out the shortcutkeys for some functionlities in the qtp for example to record ,to run ... etc
1. What is diffrence between Analog Recording And Lomlevel Recording ?
How do you create regression test packs?
anyone can explian about types of "Triggere Events" in QTP
How to load object properties to object repository through scripting.give one example
Hi All, I am using QTP for one of the Desktop application which uses Keyboard inputs like 'Tab ,F7 etc' and also mouse (Click). After recording when i am running the Script ,it is not able to recognize the keyboard inputs like F7,Tab and mouse Click because of which either i have to skip that part or manually do the inputs. Please answer how can i make script more flexible so that it will recognize both keyboard and mouse operations.
To retrive the test data which tool vl use and whats basis u vl write test data? its urgent
What is the descriptive programming?
For what purpose to we use object repository in a application?also explain usage of obj.repository?