Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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.

2144


Explain about .wsf files?

1056


How can you destroy an object in vbscript?

1052


Which in-built function related to an array joins substrings into one string in the vbscript language?

905


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.

1800


How to write functions and sub in vb script?

1051


Why to use option explicit in vb script?

997


Which operator can be used to change the value of the operand or change the state of the condition?

963


Explain the operator precedence in vb script?

1011


Explain some uses of vb script?

918


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

962


Explain what is loose binding? Why is it not a good practice to use it?

1023


How will you convert a given number to long in vbscript?

830


Mention what is the use of option explicit in vbscript?

917


What are the naming conventions while declaring a variable in the vbscript language?

988