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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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 load all resource files(function libraries,object 
repositories etc) into tests without associating them?
 Question Submitted By :: Vikramreddy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to load all resource files(function libraries,object repositories etc) into tests without associating them?
Answer
# 1
Use QTP object model for this purpose. 

Create qtp.test object. 

Under this object you will get several settings like 
RECOVERY scenario, ADD IN, VBS functions etc. 

Make a .vbs script of these settings
Open any QTP Script and then run this code. 

QTP Script will have changed resource settings. See this 
sample script which does similar task

Public Job_Name_Array1
Public Excel_file_path 

Excel_file_path = "G:\DATA FOR GRAPHICS JOBS.xls"

DefineValue




Dim qtApp 'As QuickTest.Application ' Declare the 
Application object variable
Set qtApp = CreateObject("QuickTest.Application") ' Create 
the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = False    ' Make the QuickTest application 
visible
Dim qcfolderpath 
qcfolderpath = "Subject\CAESAR II 5.00 QA PLAN\2 MAIN 
MENU\2.1 STATIC\2.1.1 INPUT PROCESSOR\INPUT GRAPHICS 
VIEW\Input Graphics QTP 9.5"

For nn = 0 To UBound (Job_Name_Array1,1)  

'For nn = 2 To 1


'qtApp.Open "[QualityCenter] Subject\CAESAR II 5.00 QA 
PLAN\QA JOBS WITH NEW FRAMEWORK\STATIC JOBS\BUILD CLEARANCE 
WO FUNCTIONS\" & Job_Name_Array1 (nn), False ' Open the test

qtApp.Open "[QualityCenter] "& qcfolderpath & "\" & 
Job_Name_Array1 (nn), False ' Open the test


For i=1 to qtApp.Test.Actions.Count
    Set qtRepositories = qtApp.Test.Actions
(i).ObjectRepositories ' Get the object repositories 
collection object of the "Login" action
   
	qtRepositories.Removeall

 	Set qtRepositories = Nothing 
Next    




Set qtTestRecovery = qtApp.Test.Settings.Recovery ' Return 
the Recovery object for the current test

If qtTestRecovery.Count > 0 Then ' If there are any default 
scenarios specified for the test
    qtTestRecovery.RemoveAll ' Remove them
End If



Set qtTestRecovery = Nothing ' Release the Recovery object

qtApp.Test.Save ' Save the test

Next 

   
qtApp.Quit ' Exit QuickTest
Set qtApp = Nothing ' Release the Application object



Function DefineValue()

    DIM objExcelApplication2 
    'DIM objWorkSheet 
    DIM Sheet2
    DIM CellData2
    Dim strExePath2
    Dim strDrv2
    Dim WshShell2
'    strDrv2 = fnGetVirtualDrive()
    
    'MsgBox strDrv
    On Error Resume Next
    Set objExcelApplication2 = CreateObject
("Excel.Application")    '....Create Excel Object
    If Err.Number <> 0 Then
       Exit Function
    End If
    
    On Error Resume Next
   ' objExcelApplication2.Workbooks.open ("G:\DATA FOR 
STATIC JOBS.xls")
    objExcelApplication2.Workbooks.open (Excel_file_path)
    
    If Err.Number <> 0 Then
        MsgBox "Please ensure that you have run the 
install.bat file before this run session"
    	Exit Function
    End If
    
  ReDim Job_Name_Array1 (0)   

For xyz = 2 To 14 

 CellData2 = objExcelApplication2.Worksheets("Sheet1").Cells
(xyz,2).Value 
 
 Value1 = Trim (CellData2) 
 
 Job_Name_Array1(xyz-2) = Value1
 
 ReDim Preserve Job_Name_Array1(xyz)
 
 'MsgBox "JobName" &( xyz-2) & "is      " & Job_Name_Array1
(xyz-2)

Next


        
objExcelApplication2.ActiveWorkbook.Close '....close the 
work book
    	objExcelApplication2.Application.Quit 	 '....quits 
Excel

    	Set objExcelApplication2 = Nothing   '....Clear all 
the references to the objects  
    	Set objWorkSheet2 = Nothing
		
 


End Function
 
Is This Answer Correct ?    0 Yes 0 No
Sandeep
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
how to write script in qtp(vbscript)..i mean with out application deployed..and how to call script1 into script2? Infosys5
What is our exact stage involvement with QTP?  1
how we connect oracle or sql data server database to qtp. TCS3
Explain about reusable actions? IBM2
How to Test Dynamic links ? Wipro3
Do you have any knowledge about Business Processing Testing in QTP Appulse1
suppose u hav a dialog or window which contains 10 buttons with same name & value. now how to check each button? i.e. how qtp indetifies these objects separately?  2
in how many ways you perform batchtesting? Sapient2
can any body help me out by providing links/material for descriptive programming in QTP otherwise can you post decriptive programing based interview Questetion&ans. plz help me out . i need it. ADP1
How can i use Ordinal identifiers and Smart identification methods suppose i want to know the index no of check box  1
If enter into interviewer room? how u introduce with him. with shakehand or waht?  2
New to QTP: In a qtp flight booking application, I tried to parameterize the to and from drop down lists using data table, depending on ur drop down selection it will pop up a list of flights. Here I am not finding a way to select flight randomly from given list... Thanks in advance guys.  1
What is the difference between action & script?  3
What is positive test case and Negative Test case? What is the meaning of Real World Scenario's?  1
Hi, When I click on a hyperlink a secondary pop-window will open. In that pop-up window there will be 'N' number of records arranged in with paging option in datagrid table. Each rows contains two columns, one is text and the other is a radio button. I will pass the first column value and based in it the tool have to select the corresponding radio button in that row. Please someone help me how to handle this as am new to QTP. CTS1
What is the latest version in QTP? Polaris26
What are the enhancements u did after recording ur script?  1
What is difference b/w AOM,DOM,COM Have u ever is used ny of the models.If so why? GE1
Why u don’t like recording the script and writing the script Wipro3
how you have used object libraries? plzzzzz do answer  1
 
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