• RSS
  • Facebook
  • Twitter

One Center for all the Testing Need. OneTestingCenter is for all, for all QA, for all Automation. Automation is easy, fun and enriching experience. Happy Learning and Happy Testing!

  • Access to All QA

    At OneTestingCenter, you find lots of books,articles,blogs and detailed guides. Everyone has access to QA. Happy Learning, Happy Testing.

  • Global Trainings

    All the QA/Auotmation trainings are available at OneTestingCenter. QA, Automation, QTP/UFT, Selenium, LoadRunner, QC/ALM, Appium...

  • Automation Learning Fun

    Technology is always evolving. Automation is always challenging. To be frank, Automation is fun, enthusiastic and enrching experience.


    'Automation Object Model

    '************************************************************************
    '************************************************************************
    ' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
    ' What ==>  QTP - AOM Script to Open QTP and to Add Shared / Global Object Repository
    ' How ==> Need QuickTest.Application Automation Object to do so
    ' Why ==> To Open a Driver Script (which could call other tests)
    '             To Add shared / Global Object Repository to QTP
    '             To Save the test
    ' Author : GAReddy @ OneTestingCenter @ QTP
    '************************************************************************ 
    '************************************************************************ 
    Dim oQTP 
    Dim QTPRepositories 
     
    ' Open QuickTest 
    Set oQTP = CreateObject("QuickTest.Application") ' Create the Application object 
    oQTP.Launch ' Launch QuickTest 
    oQTP.Visible = True ' Set QuickTest to be visible 
     
    ' Open a test and get the "Login" action's object repositories collection 
    oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False, False ' Open a test

    ActionName=Environment.Value("ActionName")

    Set QTPRepositories = oQTP.Test.Actions(ActionName).ObjectRepositories
    ' Get the object repositories collection object of the "Login" action 
     
    ' Add MainApp.tsr if it's not already in the collection 
    If QTPRepositories.Find("D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\ObjectRepository\GlobalOR.tsr") = -1 Then
           '      If the repository cannot be found in the collection 
        QTPRepositories.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\ObjectRepository\GlobalOR.tsr", 1
           ' Add the repository to the collection 
    End If 
     
    'Save the test and close QuickTest 
    oQTP.Test.Save ' Save the test 
    oQTP.Quit ' Quit QuickTest 
     
    Set QTPRepositories = Nothing ' Release the action's shared repositories collection 
    Set oQTP = Nothing ' Release the Application object 
    '************************************************************
    '*************************************************************
    Reactions:

    QTP - AOM - Add Shared Object Repository to QTP


    'Automation Object Model

    '************************************************************************
    '************************************************************************
    ' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
    ' What ==>  QTP - AOM Script to Open QTP and to Add Shared / Global Object Repository
    ' How ==> Need QuickTest.Application Automation Object to do so
    ' Why ==> To Open a Driver Script (which could call other tests)
    '             To Add shared / Global Object Repository to QTP
    '             To Save the test
    ' Author : GAReddy @ OneTestingCenter @ QTP
    '************************************************************************ 
    '************************************************************************ 
    Dim oQTP 
    Dim QTPRepositories 
     
    ' Open QuickTest 
    Set oQTP = CreateObject("QuickTest.Application") ' Create the Application object 
    oQTP.Launch ' Launch QuickTest 
    oQTP.Visible = True ' Set QuickTest to be visible 
     
    ' Open a test and get the "Login" action's object repositories collection 
    oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False, False ' Open a test

    ActionName=Environment.Value("ActionName")

    Set QTPRepositories = oQTP.Test.Actions(ActionName).ObjectRepositories
    ' Get the object repositories collection object of the "Login" action 
     
    ' Add MainApp.tsr if it's not already in the collection 
    If QTPRepositories.Find("D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\ObjectRepository\GlobalOR.tsr") = -1 Then
           '      If the repository cannot be found in the collection 
        QTPRepositories.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\ObjectRepository\GlobalOR.tsr", 1
           ' Add the repository to the collection 
    End If 
     
    'Save the test and close QuickTest 
    oQTP.Test.Save ' Save the test 
    oQTP.Quit ' Quit QuickTest 
     
    Set QTPRepositories = Nothing ' Release the action's shared repositories collection 
    Set oQTP = Nothing ' Release the Application object 
    '************************************************************
    '*************************************************************