How to write a general script which should does the
following
a). If a page object is given, it should identify the page
object of the corresponding page(site).
b). It should identify all the links of that particular
page.
in QTP tool?
Answer Posted / arun
if page object is given then..
eg> set pgObj = browser(yahoo).page(yahoo)
pgObj - is the page object
Answers:
1. we can check for the page as follows
tmpPageName = pgObj.getroproperty("name")
if tmpPageName = "Yahoo" then
msgbox "Found the page"
else
msgbox "Page Not found"
end if
2. Need to use description.create function
set descObj = description.create
descObj("micclass").value ="link"
set lnkObj = pgObj.childobjects(descObj)
msgbox lnkObj.count '// This will give you number of links
found in that page
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are the different types of loops available in the vbscript language?
What is dictionary object in vbscript? Explain?
Explain about arrays in vb script?
What's the difference between vbscript and vb.net?
Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar
what is the features of visual basic?
Which object provide information about a single runtime error in a vbscript?
In html file what is an ideal position to include vbscript?
give me any information abou vb script books learn quckly
What are keywords in the vbscript language?
What are the 2 ways in which a variable can be declared in the vbscript language?
Anyone have qtp11.0 crack?
Explain about the support of asp for vb script functionality?
Is vbscript a case-sensitive or case-insensitive?
When to use function procedures and what are its characteristics?