Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search function in repository
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi ,

I think below code is helpful to search the object in Object Repository
' Here ObjName is Logical Name of Object and ObjProperty is the Class Name of that Object
Code:
Function CheckRepository(ObjName,ObjProperty)

Dim ObjRepository , AllObjects ,iCount , i , TestObject
Set ObjRepository = CreateObject("Mercury.ObjectRepositoryUtil")
ObjRepository.load "C:\Automation_V2\Object Repository\SampleObjectRepository1.tsr"
Set AllObjects = ObjRepository.GetAllObjects(Null)
iCount=AllObjects.Count
For i=0 to iCount-1
    Set TestObject = AllObjects.Item(i)
    If  ObjName=ObjRepository.GetLogicalName(TestObject) Then
        msgbox TestObject.GetTOProperty("Class Name")
        If TestObject.GetTOProperty("Class")=ObjProperty Then
            msgbox "Object Found in ObjectRepository"
            Exit For
        End If
     End If
Next
Set TestObject = Nothing
Set AllObjects = Nothing
Set ObjRepository=Nothing

End Function
---Hema
Reply


Messages In This Thread
Search function in repository - by gbartokai - 04-16-2009, 03:28 PM
RE: Search function in repository - by Hema - 07-08-2009, 05:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CyberArk CorePAS REST API to search for accounts pramod 0 561 06-29-2023, 03:11 PM
Last Post: pramod
  Calling a function in a Test Script from a function library anupam4j 3 5,925 06-26-2015, 12:31 AM
Last Post: babu123
  Search All Test scripts For a Function? AndyBSG 1 2,582 02-19-2015, 04:15 AM
Last Post: supputuri
  Search for a string in all the files under all subdirectory Mahesh27 1 2,050 07-03-2013, 03:24 PM
Last Post: Sathiya
  Testing Search box kriday 1 2,370 06-26-2013, 08:51 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)