how do you remove object repository at runtime and load
object repository and verify it

Answers were Sorted based on User's Feedback



how do you remove object repository at runtime and load object repository and verify it..

Answer / ravindra

'Adding Repository to an action

'*********************************************************************

Dim qtApp,qtRepositories, actName, RepPath

RepPath=".TRS File Path"

actName=Environment.Value("ActionName") 'Get Action Name

Set qtApp = CreateObject("QuickTest.Application") ' Create Application Object
Set qtRepositories = qtApp.Test.Actions(actName).ObjectRepositories ' Get Associated repositories list

If qtRepositories.Find(RepPath) = -1 Then
qtRepositories.Add RepPath, 1 ' Add the Object Repository to the current action
End If

qtApp= Nothing
qtRepositories= Nothing
'*********************************************************************
'*********************************************************************

'Remove repository from an action

Dim qtApp,qtRepositories, actName, RepPath, rPosition

RepPath=".TRS File Path"
actName=Environment.Value("ActionName") 'Get Action Name

Set qtApp = CreateObject("QuickTest.Application") ' Create Application Object
Set qtRepositories = qtApp.Test.Actions(actName).ObjectRepositories ' Get Associated repositories list

rPosition=qtRepositories.Find(RepPath) 'Find the Position of the Repository

If rPosition<>-1 then

qtRepositories.Remove rPosition ' Remove Repository From the Action

End if

qtApp= Nothing
qtRepositories= Nothing

Is This Answer Correct ?    2 Yes 0 No

how do you remove object repository at runtime and load object repository and verify it..

Answer / uday

This you can do in two ways:

Use "RepositoriesCollection" utility object and use below
methods as per your needs.
RepositoriesCollection.remove(pathOfSharedOR)
RepositoriesCollection.add(pathOfSharedOR)
RepositoriesCollection.add(pathOfSharedOR)


Another way is using AOM.
A bit of coding is needed, so i am putting high level
overview. I am just posting a pseudo code here:

create a QTPObject

Get associaterepositories by some method like
"AssociatedRepositories"
set repositories=QTPObject.AssociatedRepositories

Once you have repositories you can use below methods like
repositories.remove (path)
repositories.add(path)
repositories.find(path)

I hope that helps.

Thanks,
Uday
http://qtpftvideos.blogspot.com/

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More QTP Interview Questions

what is defination of intergration testing?

2 Answers  


i have asked earlier only one question how to test web application using QTp plz send me the answer quickly

0 Answers  


What is the difference between local and shared object repository in qtp?

0 Answers  


Anybody explain me, the concept of checkpoint declaration in the QTP mainly for the Objects, Pages, Text and Tables ?

1 Answers  


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

0 Answers   Ordain Solutions,


Is it mandatory to know abt regular expression in descriptive programming

2 Answers  


How can we get the result from WindowsXP Command Window? (e.g. After we input 'ipconfig' in command window, how QTP get the result?)

3 Answers  


How to execute a winrunner script in quicktest professional?

0 Answers  


Hi! My OTP script has several bitmap checkpoints included which I check in the test results xml file. The test is for SAP 4.7. I need to save these bitmaps to files or at least export them to the html file using the export function in the test results viewer. Could you please help me with this problem? Thank you in advance! Best regards, Peter

0 Answers   TCS,


How to import excel sheet to QC?

1 Answers  


how you update scripts in qtp?

1 Answers  


Shared Object Repository is preferable while dealing with dynamic objects ok? descriptive prog also same? ok but why descriptive?(only for w/o application)

2 Answers   IBM,


Categories