• 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 ==>  This is a QTP - AOM Script to Open QTP , To Open Driver Script, To Add the functional LIBs to QTP  and to Run the Test
     ' and store the results on to specified results directory (using the Run options)
    ' How ==> Need QuickTest.Application Automation Object to do so
    ' Why ==> To Open a Driver Script (which could call other tests)
    '                                 To Add the Functional Library files to QTP
    '                                 To Run the tests
    '                                 To Save the test results
    ' Author : GAReddy @ OneTestingCenter @ QTP
    '********************************************************************** 
    '******************************************************************* 
    Dim oQTP 
    Dim QTPLibraries   
    ' 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 its libraries collection 
    oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False, False ' Open a test 
    Set QTPLibraries = oQTP.Test.Settings.Resources.Libraries ' Get the libraries collection object 
     
    ' To check if the LIBs are added to QTP..If not ...add them
           'If QTPLibraries.Find("D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs") = -1 Then
           ' If the library cannot be found in the collection 
           '    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs", 1
           ' Add the library to the collection 
           'End If 

    ' To add functional LIBs to QTP
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebButtonvbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_Link.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Image.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Generic.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Driver.vbs", 1

    Set QTPResultsOptions = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object 
    QTPResultsOptions.ResultsLocation = "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestResults\Res1" ' Set the results location 
     
    QTPTest.Run QTPResultsOptions ' Run the test 
    'Save the test and close QuickTest 
    oQTP.Test.Save ' Save the test  
    Set QTPLibraries = Nothing ' Release the test's libraries collection 
    oQTP.Quit ' Quit QuickTest 
    Set oQTP = Nothing ' Release the Application object 
    '************************************************************************ 
    '************************************************************************
    Reactions:

    QTP - AOM - Add Functional Libraries - Run Tests - Save Results


    'Automation Object Model

    '************************************************************************
    '************************************************************************ 
    ' GAReddy @ OneTestingCenter @ QTP - AOM (Automation Object Model)
    ' What ==>  This is a QTP - AOM Script to Open QTP , To Open Driver Script, To Add the functional LIBs to QTP  and to Run the Test
     ' and store the results on to specified results directory (using the Run options)
    ' How ==> Need QuickTest.Application Automation Object to do so
    ' Why ==> To Open a Driver Script (which could call other tests)
    '                                 To Add the Functional Library files to QTP
    '                                 To Run the tests
    '                                 To Save the test results
    ' Author : GAReddy @ OneTestingCenter @ QTP
    '********************************************************************** 
    '******************************************************************* 
    Dim oQTP 
    Dim QTPLibraries   
    ' 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 its libraries collection 
    oQTP.Open "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestScripts\DriverScript", False, False ' Open a test 
    Set QTPLibraries = oQTP.Test.Settings.Resources.Libraries ' Get the libraries collection object 
     
    ' To check if the LIBs are added to QTP..If not ...add them
           'If QTPLibraries.Find("D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs") = -1 Then
           ' If the library cannot be found in the collection 
           '    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs", 1
           ' Add the library to the collection 
           'End If 

    ' To add functional LIBs to QTP
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebEdit.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_WebButtonvbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\TO_Link.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Image.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Generic.vbs", 1
    QTPLibraries.Add "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\LIBs\Driver.vbs", 1

    Set QTPResultsOptions = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object 
    QTPResultsOptions.ResultsLocation = "D:\GAReddy\OneTestingCenter\QTP\AprilBatch\KeywordDrivenFramework\TestResults\Res1" ' Set the results location 
     
    QTPTest.Run QTPResultsOptions ' Run the test 
    'Save the test and close QuickTest 
    oQTP.Test.Save ' Save the test  
    Set QTPLibraries = Nothing ' Release the test's libraries collection 
    oQTP.Quit ' Quit QuickTest 
    Set oQTP = Nothing ' Release the Application object 
    '************************************************************************ 
    '************************************************************************