ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
How to create frame work for qtp?
 Question Submitted By :: Suresh
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to create frame work for qtp?
Answer
# 1
Test Driver Frame Work in QTP

Components Required For Test Driver Frame Work

1.	Spread Sheet.xls
2.	Main Script QTP File
3.	Script Folder (all script has been saved as .VBS 
File and saved under this folder
4.	Object Folder (all Object Repositories Shared File 
has been saved as .tsr file and saved under this folder


Concept of Test Driver Frame Work

	Test Driver Frame Work is purely meant for running 
the script one by one and no need to bother any test 
engineer to care about. If the project contains more than 
100 scenarios to automate, and we need to execute the same 
one by one. So we need a test engineer to execute it. But 
if we design the Test Driver Frame Work we need to do only 
setting the flag value to “y” or “n”. In order to execute 
the script set the flag value as “y” else “n”. 
	All the script files are saved as .VBS file and 
saved in the Script Folder and the path of the Script file 
path should be populated in the Script_Path Column in the 
Spread Sheet.xls file.
	All the Shared Repositories file are saved as .tsr 
file and saved in the Object Folder and the Object 
Repository File Path should be populated in the 
Repository_Path Column in the Spread Sheet.xls file.
	In the Main Script we are calling the 
Spreadsheet.xls file and we get the row count from the 
sheet and we are sending the row count to the loop. First 
the active row is set to Row1 and we fetch the value from 
Flag, if the value of flag is “y” then we fetch the value 
of script path and repositorypath  and we call appropriate 
script and object repositories. if the value of flag is “n” 
we will execute that row and the pointer is send to next 
row.
	By this we can execute all the scenarios without a 
test engineer, only we have to do is invoking the Main 
Script in the QTP.


Folder Structure

 -->TDF (Folder)
    -->Main Scripts (Folder)
            |
            |--> Scripts in .VBS extensions
    -->Object
    -->Script
    -->Spreadsheet.xls
      
           
	




Spread Sheet.Xls

sino	Scenario Name	Script_Path	Repository_Path	Flag
1	insert	c:\tdf\script\insert.vbs
	c:\tdf\object\insert.tsr	y
2	open	c:\tdf\script\open.vbs
	c:\tdf\object\open.tsr	y
3	graph	c:\tdf\script\graph.vbs
	c:\tdf\object\graph.tsr	y
				


Main Script (saved as a QTP File)

systemutil.Run("C:\Program Files\Mercury 
Interactive\QuickTest 
Professional\samples\flight\app\flight4a.exe")
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").Click
datatable.AddSheet("newsheet")
datatable.ImportSheet "c:\tdf\spreadsheet.xls","sheet1","new
sheet"
n=datatable.GetSheet("newsheet").getrowcount
For i = 1 to n
	datatable.SetCurrentRow(i)
	flag=datatable("Flag","newsheet")
	If flag = "y" Then
		 scriptpath=datatable.Value
("Script_Path","newsheet")
         objpath=datatable.Value
("Repository_Path","newsheet")
		 repositoriescollection.RemoveAll
		 repositoriescollection.Add(objpath)
		 executefile scriptpath
		 repositoriescollection.RemoveAll
	End If
Next

Script Folder

Script File

Insert  Script

Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").WinObject("Date of 
Flight:").Type "111111"
Window("Flight Reservation").WinComboBox("Fly 
From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly 
To:").Select "Frankfurt"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList
("From").Select "12536   LON   08:00 AM   FRA   08:45 AM   
AA     $100.50"
Window("Flight Reservation").Dialog("Flights 
Table").WinButton("OK").Click
Window("Flight Reservation").Activate
Window("Flight Reservation").WinEdit("Name:").Set "raja"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").Activate

Open Script

Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").WinButton("Button_2").Click
Window("Flight Reservation").Dialog("Open 
Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit
("Edit_2").Set "4"
Window("Flight Reservation").Dialog("Open Order").WinButton
("OK").Click

Graph Script

Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button_2").Click
Window("Flight Reservation").WinButton("Button").Click
 
Is This Answer Correct ?    4 Yes 0 No
Rajarathnam
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
Tell me Three major differences between QTP & Winrunner?  2
Hi, Can any body please tell me how to create framework in qtp & where i can get some material to learn about it. regards, rahulT  1
For Usability testing, which is preferable Automation or Manual?  5
please send detail navigation for merging of object ripositories in QTP 8.2 Ordain-Solutions3
wht is Automation testing frame work. pls explain it Wipro3
how quick test record on dynamically generated urls and web pages. Infosys2
Hi Everybody, Can anybody please tell me the how to display the result of the QTP in the notepad text file rather than in the QTP result window. Suppose this is my simple script:WHich will open the notepad file and enter some text and then will change the font then will calculate how much time has been taken.Now, in this script i want to display the result in notepad file. Dim s Dim starttimer,endtimer,timeit s="uyetuywqtywqte" SystemUtil.Run "notepad","","Y:\","" Window("Notepad").WinEditor("Edit").Type micCtrlDwn + "s" + micCtrlUp Window("Notepad").Dialog("Save As").WinEdit("File name:").Set "test1" Window("Notepad").Dialog("Save As").WinEdit("File name:").Type micReturn Window("Notepad_3").Type s Window("Notepad_3").WinEditor("Edit").Type micCtrlDwn + "s" + micCtrlUp starttimer=timer Window("Notepad_3").WinMenu("Menu").Select "Format;Font..." Window("Notepad_3").Dialog("Font").WinEdit ("Font:").Type "cou" + micDwn Window("Notepad_3").Dialog("Font").WinComboBox ("Font:").Select "Courier" Window("Notepad_3").Dialog("Font").WinEdit ("Font:").Set "Courier" Window("Notepad_3").Dialog("Font").WinEdit("Font:").Type micReturn endtimer=timer timeit=endtimer-starttimer print(timeit) Please also tell me where the function for the text file result will be declared and where it should be called. Thanks, Gaytri  2
write vbscript on veb applications in qtp with exapmles?  1
Explain the concept of object repository & how QTP recognises objects?  1
Use of Multiple Actions in QTP?  2
How to connect to oracle(sqlserver) database to QTP CTS3
one ok button and one text box is there.when i click on ok button in that text box one no. will display from 1 to 100 randomley.if that is not 100 when we click on ok button again ,again another text box ll created with another no. we will continue this till the text box created and displays 100.and when its 100 ok button should disabled. remember thet no will display not seriely ,it displays randomley,and each time new text box will created. ADP5
how i can delete the excel process for the task manager using QTP  2
What is AUT in object reposity in QTP? Why we use it in Object repository???What is full form???????  2
we have 10 more actions in our test and we are using exit action command to come out from the action if any error s occured.In action 1 if any error occurs control is moving to second action but if we get error in second action exitaction is throwing general run error. Please give a idea to overcome . TCS1
give the code to count child objects (Total) in the page  1
hi i have one issue while coding the dates . i want to add the date curret to 4 days . can any one helme plz about this regards balaji  2
How to Set the Global Sync Timeouts in QTP?  1
what are recovery management techiniques? BirlaSoft2
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  3
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com