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
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
Explain about .wsf files?
How can you destroy an object in vbscript?
Which in-built function related to an array joins substrings into one string in the vbscript language?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
How to write functions and sub in vb script?
Why to use option explicit in vb script?
Which operator can be used to change the value of the operand or change the state of the condition?
Explain the operator precedence in vb script?
Explain some uses of vb script?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
Explain what is loose binding? Why is it not a good practice to use it?
How will you convert a given number to long in vbscript?
Mention what is the use of option explicit in vbscript?
What are the naming conventions while declaring a variable in the vbscript language?