Hello,

Can we capture only the labels of the web page in the
object repository. If yes, then how.

Actually my scenario is:
I have to capture all the label of mercury site
http://newtours.mercuryinteractive.com/tour/mercurypurchase.
php.
and want to copy all these labels in the notepad.

So,please help me how to do this all.


Thanks in advance,
Gaytri

Answers were Sorted based on User's Feedback



Hello, Can we capture only the labels of the web page in the object repository. If yes, then ho..

Answer / chaitu.c

This is process of the above asked question
step1 QTP Tool put in Record mode after that
step2 Double click on the internet explore
Step3 enter the web site
step4 after enter the we site stop the recoreding in QTP
after you will get the following lines( 2,3,5,8)of code in
QTP

Line: 1 Dim a,b
Line: 2 Window("Program Manager").WinListView
("SysListView32").Activate "Internet Explorer"
Line: 3 Browser("Browser").Page("Page").Sync
Line: 4 b = Inputbox("Enter the Site")
Line: 5 Browser("Browser").Navigate b
Line: 6 a = Browser("Browser").Page("ALL
Interview .com ::").GetROProperty("url")
Line: 7 msgbox a
Line: 8 Browser("Browser").Page("ALL
Interview .com ::").Sync
'Create the Notepad file and Save the url in that
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("D:\Documents and
Settings\Administrator.SEERVER\Desktop\chaitu.txt", True)
MyFile.WriteLine(a)
MyFile.Close

Is This Answer Correct ?    0 Yes 0 No

Hello, Can we capture only the labels of the web page in the object repository. If yes, then ho..

Answer / chaitu.c

Browser("Browser").Page("Welcome: Mercury Tours").WebEdit
("userName").Set "chaitanyakumar2005"
a = Browser("Browser").Page("Welcome: Mercury
Tours").WebEdit("userName").GetROProperty("name")
msgbox a
Browser("Browser").Page("Welcome: Mercury Tours").WebEdit
("password").SetSecure "462974ae67a58c7d26974858f8a5b00fa630
"

Is This Answer Correct ?    0 Yes 1 No

Hello, Can we capture only the labels of the web page in the object repository. If yes, then ho..

Answer / chaitu

Line: 1 Set a = Browser("Browser").Page
("Page").StaticLabeltext

Line: 2 msgbox a

Step:3
'Create the Notepad file and Save the url in that

Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("D:\Documents and
Settings\Administrator.SEERVER\Desktop\chaitu.txt", True)
MyFile.WriteLine(a)
MyFile.Close

Is This Answer Correct ?    0 Yes 1 No

Hello, Can we capture only the labels of the web page in the object repository. If yes, then ho..

Answer / guest

Good Question.......

here i used regular expressions concept with descriptive
prgming...Rough idea given to u...surely this approach can
work out...

Set opage=browser("Gmail: Email from Google").Page("Gmail:
Email from Google")
Set childobjdes = Description.Create()
childobjdes("mic class").value="Web Element"
childobjdes("html tag").value=".*[A-Za-z0-9].*"
childobjdes("outer text").value =".*[A-Za-z0-9].*"
set allobj = opage.ChildObjects(childobjdes)
msgbox allobj.count
For i=1 to allobj.count-1
text=text&allobj(i).getroproperty("outer text")
Next
msgbox text

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

in QTP,how to write a descriptive program for "yahoo" or "gmail" Login page

1 Answers  


How to test fly out menu in qtp?

0 Answers  


diff between global variables and environment variables in qtp?

1 Answers   FIS,


what is the difference between QTP 8.0 & 9.0?

4 Answers  


What is repository parameters in QTP?how will we define that????what is unmapped & mapped repository parameters????????

1 Answers  






banking domain description for software tester for interview

0 Answers   Semantic Space,


Diff b/w test scenario's and test Procedures?

0 Answers  


What does Reporter.Reortevent2 does?

2 Answers  


QTP identified the object but not performing the desired action???what could be the reason?????

1 Answers   Mphasis,


in QTP we test web based application at that time what script is run? is support vb script? plz tell me

3 Answers  


How can we add regular expression for date field (dd/mon/yyyy)?

3 Answers   CTS,


Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?

0 Answers   Accenture,


Categories