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?

Answers were Sorted based on User's Feedback



How to write a general script which should does the following a). If a page object is given, it ..

Answer / 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

How to write a general script which should does the following a). If a page object is given, it ..

Answer / isha menon

I dont know the rite answer for this question,. But this
question will be very much useful to know more about the
main testing tool QTP,.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More VB Script Interview Questions

I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

0 Answers  


Out of the different type of operators, which are evaluated first and last in the vbscript language?

0 Answers  


How can you have different number of cells for each row of a table in HTML?

2 Answers  


How can I access an object in another frame?

1 Answers  


Hi, Anybody could tell me What is the 3rd Largest Number in the series..Thanks in Advance..

3 Answers   Amazon, bcbs,






How will you generate Reports using Vb Script?it asked in testing(QTP)Interview.Plz Any Body Let me know. Thanks uday Uday_testing@yahoo.co.in

4 Answers   NIIT,


Which command is used for writing text on a page?

0 Answers  


What is string concatenation function in VBScript?

2 Answers  


How can constants be declared in the vbscript language?

0 Answers  


Mention what is select case statement?

0 Answers  


What is purpose of scripting.filesystemobject class in vbscript?

0 Answers  


how does vb script help in web page designing? explain with example.

0 Answers  


Categories