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
How will you get the smallest subscript of an array in vbscript?
What is loose binding? Why is it not a good practice to use it?
Explain about tristate constants in vbscript?
How will you format a number in percetage format in vbscript?
what types of bugs will we find out in banking projects for automation testing?
Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?
Mention how to assign a date value to a variable?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
Explain about adodb.stream class?
What is the use of the recordset object and which statement is used to create such an object?
Mention what is select case statement?
Explain about .wsf files?
How to assign a date value to a variable?
What is the use of option explicit statement?
Which date function is used in the vbscript language to find the difference between the 2 dates?