GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  QTP

 Print  |  
Question:  How to use automation object to load the library files in QTP. I tried to use this stmt" set App = createobject("Quicktest.Application")
App.Test.Settings.Resources.Libraries.Add ("F:QTPrepository.vbs"),1 ".could u pls help how to add it by script itself? what is executefile concept? is it workaround to my question?




March 03, 2006 06:33:56 #1
 Konka Ravi Krishna   Member Since: Visitor    Total Comments: N/A 

RE: How to use automation object to load the library f...
 

This code will add the library files:

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable

Dim qtLibraries 'As QuickTest.TestLibraries ' Declare a test's libraries collection variable

Dim lngPosition

' Open QuickTest

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

qtApp.Launch ' Launch QuickTest

qtApp.Visible = True ' Set QuickTest to be visible

' Open a test and get its libraries collection

qtApp.Open "C:\Test1", False, False ' Open a test

Set qtLibraries = qtApp.Test.Settings.Resources.Libraries ' Get the libraries collection object

' Add Utilities.vbs if it's not in the collection

If qtLibraries.Find("C:\sai1.vbs") = -1 Then ' If the library cannot be found in the collection

qtLibraries.Add "C:\sai1.vbs", 1 ' Add the library to the collection

End If

     

 

Back To Question