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 to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
How will you compare two strings in vbscript?
Mention the rules for using option explicit statement?
Which operator can be used to do an xor operation in vbscript?
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
What is the use of the date function in the vbscript language?
Explain the scope of the variables using dim, public, and private keywords respectively.
after medical test,when will be the police verification
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com
Which operator can be used to change the value of the operand or change the state of the condition?
Explain about scrrun.dll in vbscript?
Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)
How will you get the natural logarithm of the given number in vbscript?
why variable name should not exceed 255 characters?