Rem declaring Variables
Dim qtApp 'QuickTest.Application object variable
Dim qtRepositories 'QuickTest.Repositories object variable
' Create the QTP Application object
Set qtApp = CreateObject("QuickTest.Application")
' Create the Repositories object
Set qtRepositories = qtApp.Test.Actions("DriverScript").ObjectRepositories
' If there are any Repository , remove them
qtRepositories.RemoveAll()
' Add Repository
qtRepositories.Add(strRepositoryFilePath)
' Release the Application object
Set qtApp = Nothing
' Release the Repositories object
Set qtRepositories = Nothing
==========OR========
Use below code- below code is supported after QTP 9.5 versions.
RepositoriesCollection.Add "C:\Test.tsr"
Dim qtApp 'QuickTest.Application object variable
Dim qtRepositories 'QuickTest.Repositories object variable
' Create the QTP Application object
Set qtApp = CreateObject("QuickTest.Application")
' Create the Repositories object
Set qtRepositories = qtApp.Test.Actions("DriverScript").ObjectRepositories
' If there are any Repository , remove them
qtRepositories.RemoveAll()
' Add Repository
qtRepositories.Add(strRepositoryFilePath)
' Release the Application object
Set qtApp = Nothing
' Release the Repositories object
Set qtRepositories = Nothing
==========OR========
Use below code- below code is supported after QTP 9.5 versions.
RepositoriesCollection.Add "C:\Test.tsr"
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.