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

wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......

1479


Mention what is the difference between vbscript and vba?

505


Which event is triggered when mouse focus comes out of an element in the vbscript language?

505


what is used of Property........End Property loop ? how to write the script for it?

1678


i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me

1789






Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

2253


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

2543


can anyone tell me the procedure of interview held in applabs

1746


What is event handling in vbscript?

589


how to automatically update the sql server2005 database records when insert in vb6?

1475


Explain some uses of vb script?

545


How will you get a subset of a array in vbscript?

577


How will you reverse a string in vbscript?

611


How are values assigned to the variables in the vbscript language?

565


How to capture a runtime error in vbscript?

622