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

write a vb script to generate fibonnaci numbers

1 Answers  


What are the different types of operators and their order of precedence?

0 Answers  


what is the features of visual basic?

0 Answers  


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

0 Answers   CSC,


how to set one column as primary key in QTP and fetch values accordingly

0 Answers   Ford,






What is the use of "Option Explicit"?

2 Answers  


What is the event handling in vbscript?

0 Answers  


How to write VB Script for selecting a particular row in a WebTable?

1 Answers   Patni,


Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

0 Answers   Microsoft,


How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1+arg2 N2=arg1-agr2 N3=arg1*agr2 N4=arg1/arg2 Value= How to pass ? End Function

3 Answers   iGate,


How to insert snapshot during manual scripting in QTP?

1 Answers  


What is a difference between scripting language and programming language?

2 Answers  


Categories