SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jun 2004
    Location
    Miami,FL
    Posts
    949
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Loading Addins associated with the test

    When I open a test, QuickTest notifies me if an associated add-in is not currently loaded, or if I have loaded add-ins that are not currently associated with my test. This process ensures that my run session will not fail due to unloaded add-ins.
    is there any way to set the QTP addins programatically so it will use same addins I am using for my current test therefore I won't get the addins notification meaasge?
    Thank you,
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Loading Addins associated with the test

    You can do this via Automation Object Model.

    Mark Smith.

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Location
    Miami,FL
    Posts
    949
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Loading Addins associated with the test

    Thanx Mark I tried the AOM
    however am getting this error: Object required: '[string: "[QualityCenter] Subj"]'

    'in QTP I have
    Set testPath = "[QualityCenter] Subject\Automated\Main"
    QTPLoadAddins testPath

    ' QTPLoadAddins is a Sub described as follows:
    Sub QTPLoadAddins(TestPath)
    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Dim blnNeedChangeAddins ' Declare a flag for indicating whether the test's associated add-ins are currently loaded
    Dim arrTestAddins ' Declare the variable for storing the test's associated add-ins
    msgbox "start the add-ins"
    Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

    arrTestAddins = qtApp.GetAssociatedAddinsForTest(TestPath) ' Create an array containing the list of addins associated with this test

    ' Check if all required add-ins are all already loaded
    blnNeedChangeAddins = False ' Assume no change is necessary
    For Each testAddin In arrTestAddins ' Iterate over the test's associated add-ins list
    If qtApp.Addins(testAddin).Status <> "Active" Then ' If an associated add-in is not loaded
    blnNeedChangeAddins = True ' Indicate that a change in the loaded add-ins is necessary
    Exit For ' Exit the loop
    End If
    Next

    If qtApp.Launched And blnNeedChangeAddins Then
    qtApp.Quit ' If a change is necessary, exit QuickTest to modify the loaded add-ins
    End If

    If blnNeedChangeAddins Then
    Dim blnActivateOK
    blnActivateOK = qtApp.SetActiveAddins(arrTestAddins, errorDescription) ' Load the add-ins associated with the test and check whether they load successfully.
    If Not blnActivateOK Then ' If a problem occurs while loading the add-ins
    MsgBox errorDescription ' Show a message containing the error
    WScript.Quit ' And end the automation program.
    End If
    End If

    If Not qtApp.Launched Then ' If QuickTest is not yet open
    qtApp.Launch ' Start QuickTest (with the correct add-ins loaded)
    End If
    qtApp.Visible = True ' Make the QuickTest application visible

    qtApp.Open TestPath ' Open the test
    Set qtApp = Nothing ' Release the Application object

    msgbox "QTP ADD-ins loaded successfully"

    End Sub
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Loading Addins associated with the test

    Don't use
    Set testPath = "[QualityCenter] Subject\Automated\Main"

    use

    testPath = "[QualityCenter] Subject\Automated\Main"

  5. #5
    Senior Member
    Join Date
    Jun 2004
    Location
    Miami,FL
    Posts
    949
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Loading Addins associated with the test

    Thanx Tarun
    but now am getting "Type mismatch:QTPLoadAddins"
    however TestPath is a string!
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.33%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:18 PM.

Copyright BetaSoft Inc.