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

Which command is used for writing text on a page?

0 Answers  


how to write validation function for date in vb script

0 Answers  


write script to open Gmail.com, and to write script for entering username and password and show whether the result as pass or fail

2 Answers   Thomson Reuters,


Explain a few date functions in vbscript

0 Answers  


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  






how to comvert 120 into one hunderd twenty rupees only and vice varsa

0 Answers  


Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.

0 Answers  


what is fire event method in qtp?

3 Answers   TCS,


Hi Friends, I am facing some issues with If,else condition,i.e. i am working on some web page for ex:gmail page.now if i want to check if username is incorrect or already exist,i want to display error message in my test report,for this i am using a simple code first,i.e. If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "Shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If But still i am getting a syntax error If Browser("Gmail: Email from Google").Page("Gmail: Email from Google").WebEdit("Email").Set "shekhar.g"= true Then Msgbox ("Username Does not Exist!") Else msgbox ("Welcome !") End If I don't feel any thing wrong in this syntax but i don't understand why it shows such error,i am confused what went wrong,please help me out & do the favor,thanks a lot....

1 Answers  


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

0 Answers  


What is the extension of the vbscript file?

0 Answers  


Why is it recommended to close the database connection every time after the work is completed?

0 Answers  


Categories