how do you remove object repository at runtime and load
object repository and verify it
Answers were Sorted based on User's Feedback
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 |
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 |
There are two tabs in the application suppose, A and B.On clicking the tab "A" one table grid will open. if u click on tab "B" Another table gride will open. Now can I do some operations on both table grids with a single table grid properties in the object repository? I have added all objects of the first table grid into the object repository Now iam checking enable/disable status of "save button" in the second table grid my code is like this val=javawindow("zseries").javabutton("save").getroproperty ("enabled") when I highlighting the save button in the object repository by keeping open the second tablegrid on the application.It is displaying the popup message"The selected object can not be found in the application" can I use properties of one table grid for both tabs if so how it is possible. Can anyone help me
If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?
explain virtual object? in detailed? pls any one explain me?
Hi all please solve this.It is urgent..... When I right clicked on a Web image manually It displayed Open link,open link in new window,save picture as, Email picture,Printpicture,propeties...etc. While automation I have written a code like this 'browser("Google").Page("ramseeker®: Memory and_3").Image ("graphOfModel").Click 10,10,micRightBtn But the right click menu was not displayed. I want to save that image in a seperate folder
what is object spy
what is test data
If requirments changed then how we can teach the QTP this is the new requirment
What is checking bitmaps?
What are the features supported by UFT?
Suppose there is a bitmap with some text in it how do you write the script to get the text.
how to retrive that the number of spaces are in a string ????
How can we count the no of rows are available in a data table ?