Facebook

Course Name Start Date Time Duration Registration Link
No Training Programs Scheduled ClickHere to Contact
Please mail To sudhakar@qtpsudhakar.com to Register for any training

Thursday, June 18, 2009

QTP Scripts Upgrade Tool

HP Introduced a new utility QuickTest Asset Upgrade Tool to update QTP scripts from older version to QTP 10. 

Why to upgrade QTP Scripts?
When opening QTP scripts, if the scripts are developed by using older version of QTP, then QTP will open the scripts in Read-Only mode. To modify or update scripts, we must upgrade QTP scripts to latest version. 
The QuickTest Asset Upgrade Tool introduced to upgrade scripts from older version to QTP 10. 
An asset can be a QuickTest testing document or any resource file that is used by a QuickTest testing document. 
Assets of QTP 
  • Tests
  • Components
  • Application areas
  • Shared Object Repositories
  • Function Libraries
  • Recovery Scenarios
  • External data tables
This tool enables you to upgrade scripts, in a batch, all the QuickTest assets in a Quality Center project from an earlier QuickTest version to the current format and to convert testing document attachments to the new resources and dependencies model. 
This tool is intended for use only by the Quality Center Administrator and must be run during the Quality Center upgrade process, before you begin working with Quality Center integration features. 
The QuickTest Asset Upgrade Tool for Quality Center is the only way to upgrade QuickTest assets in a Quality Center 10.00 project, from an older QuickTest version to the current format.
Is there any other way to upgrade QTP Scripts? 
When you manually open a test that was created using an older version of QuickTest, you may be asked whether you want to convert it or view it in read-only format. 
You can choose convert tests option and save it. If the test contains calls to external actions (actions stored in other tests), you must open, convert and save those tests, too. 
Important Considerations 
  • If the test contains objects in the local object repositories of one or more actions in the test, the relevant add-in must be installed to convert the test to the current format. 
  • If you choose to convert the test, it is updated to the current format and you can modify it as needed. If you save the converted test, it cannot be used with earlier versions of QuickTest. 
  • If you choose to view the test in read-only format, it appears as it did previously, using all of its original settings, but you cannot modify it. 
  • You cannot open a test that was created with a later version of QuickTest on a computer running an earlier version of QuickTest. For example, you cannot open a test created in QuickTest 10.00 on a computer running QuickTest 8.0. 
Here is a sample script using AOM to update scripts from older version to latest version. Copy below script to a VBS file, give your script path in function call, save and execute.

'*******************************************************************
fnUpgradeQtpScripts("C:\Sample Old scripts")

Function fnUpgradeQtpScripts(ScriptsPath)

    Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
    Dim filesys
    Dim maindir
    Dim testCol
    Dim checkfolder
    
    ' Create the QuickTest Professional object
    Set qtApp = CreateObject("QuickTest.Application")
    qtApp.Launch
    qtApp.Visible = True
    
    ' Get the collection of test scripts
    Set filesys = CreateObject("Scripting.FileSystemObject")
    Set maindir = filesys.GetFolder(ScriptsPath)
    Set testCol = maindir.SubFolders
    
    ' Loop through each test in the collection
    For Each fl In testCol
    
        ' Verify the folder is a QTP test
        checkfolder = fl.Path & "\Action0"
        If (filesys.FolderExists(checkfolder)) Then ' The folder is a QTP test folder
    
           ' Convert test
           qtApp.Open fl.Path, False, False
           
           For wTime=1 To 10
           
               If lcase(qtApp.GetStatus)="ready" Then
                   qtApp.Test.Save    ' Save converted test
                   Exit for
               Else
                wscript.sleep 1000
               End If
               
           Next
                
        End If
    Next
    
    qtApp.Quit
    
    ' Release the File System Objects
    Set testCol = Nothing
    Set maindir = Nothing
    Set filesys = Nothing
    
    ' Release the QuickTest Professional application object
    Set qtApp = Nothing

End Function
'*******************************************************************

1 comment :

  1. Hi,
    How do i get the "QTP asset upgradation tool for quality center". if you have any links please share it.

    thanks,
    Uday

    ReplyDelete