Use an Automation Object Model to load the Shared Object Repository?

QuickTest Professional 9.0
QuickTest Professional 9.0 does not support dynamically loading object repositories at runtime. AOM statements are not designed to be executed from within a test script.

QuickTest Professional 9.0 does allow you to associate and load (not at runtime) multiple Object Repository files.
QuickTest Professional 8.2 and below
Use the Automation Object Model to specify the path to a Shared Object Repository:

Dim App ‘As Application
Set App = CreateObject(“QuickTest.Application”)
App.Test.Settings.Resources.ObjectRepositoryPath = “<PathToYourSharedRepositoryTsrFileHere>”

Note:
Be sure to replace <PathToYourSharedRepositoryTsrFileHere> with the path to the repository you want to use.

Now the test will load and use the specified Shared Object Repository.

Note:
You may be able to execute the AOM statements from within a script, however they are not intended to be used this way. Whenever possible, check your conditions and modify the settings in an external .vbs file before the test execution begins.

One Response to “Use an Automation Object Model to load the Shared Object Repository?”

  1. Sreekanth Simhadri Says:

    Dim qtApp ‘As QuickTest.Application ‘ Declare the Application object variable
    Dim qtRepositories ‘As QuickTest.ObjectRepositories ‘ Declare an action’s object repositories collection variable

    Set qtApp = CreateObject(“QuickTest.Application”) ‘ Create the Application object

    Set qtRepositories = qtApp.Test.Actions().ObjectRepositories ‘ Get the object repositories collection object of the “Login” action
    qtRepositories.Add , 1

    ‘Now U’r all set to add use the repository assets

Leave a comment