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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which recording modes need more memory?

576


Hi we are using QTP9.0 for Seibel Application and this seibel application will give you a popup messagebox which is of web , so qtp takes 3 mins to recognize the messagebox and to click on it , we have more number of messageboxes like this . please suggest me some solution

1664


hi, can u tell me the QTP TEsting process in present real time companies?(beware of this... now a days Recording is not using,, only DP) and don't tell note book answers like step 1 spep2....like this .......post answer with professional skills in simple english words) thank u

1322


I want to read XML file loaded in Quality center and compare the values with the values displayed in Application (web table).How can I do that

1391


what is review

1608






what is the difference between modular framework & datadriven framework

1593


What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?

602


What is the process of synchronizing qtp and aut?

566


How you can write contexts to text file in qtp?

588


What is the use of sendkeys and what are send keys

1947


What are the benefits of quick test pro(qtp)?

558


iam have done mba(finance)in 2008. in 2008 one reputed consultancy came off campus interview our institution. i got job as "manual test engineer". now iam working as "manual testing engineer". now my problem is when iam going interview the interviewer asking like " ur mba gradute how can u get job in test engineer." this question i have faced every interview. iam explaining how iam getting job. but they are not trust me". pls tell me answer how i am giving relavent ans.. this is my mail id y.ramana84@gmail.com

1398


They asked by using qtp recording writing scripting

2069


In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer

1934


how to fetch the values from grid? & qtp recogniges that grid as a webelement? what u do?

1902