Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add multiple Object repositories at run time
#1
Solved: 11 Years, 4 Months ago
i have a function calls a single Object repositories at run time. Its
passed as a parameter from the ACTION. If i have multiple OR , how i
should modify this function. My code is as follows for function. Can i
pass an array of OR

Code:
Sub loadUnloadOR(repName)
       On error resume next
       Dim fso
       Set fso=CreateObject("Scripting.FileSystemObject")
       strTestPath=Environment.Value("TestDir")
       strBinPath=fso.GetAbsolutePathName(strTestPath & "..\\..\\..\\..\
\rep")
       repPath=strBinPath & "\" & repName
       RepositoriesCollection.RemoveAll()
       RepositoriesCollection.Add(repPath)
       Set fso=Nothing
       Exit sub
End Sub

In action i use

Code:
repName="login.tsr"
call loadUnloadOR(repName)

Again as i said , can i pass an array of OR as parameter ir repName

thanks in advance
-anil
Reply
#2
Solved: 11 Years, 4 Months ago
Pass the multiple repositories name like "login.tsr|logout.tsr". Use Split and then use a for loop like:
Code:
repName = Split("login.tsr|logout.tsr", "|")

RepositoriesCollection.RemoveAll()

For intItemCnt = 0 To UBound(repName)

   repPath=strBinPath & "\" & repName(intItemCnt)

   RepositoriesCollection.Add(repPath)

Next
Reply
#3
Solved: 11 Years, 4 Months ago
thanks a lot for your valuable solution
regards-anil
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  swfwindow object name getting changed after each run saniya 1 1,692 10-10-2018, 09:02 PM
Last Post: TheGlovner
  Object identification is taking too much time JACKSPARROW 0 1,702 01-17-2017, 11:08 AM
Last Post: JACKSPARROW
  QTP not recogonising object during run time Lavanya N 2 3,729 10-28-2015, 12:46 PM
Last Post: vinod123
  Writing to Run time data table Neetha 5 12,182 08-27-2015, 10:18 AM
Last Post: supputuri
  How to add all objects manually in object repository rajaselvan.d 2 12,685 10-10-2014, 05:08 PM
Last Post: nivedita

Forum Jump:


Users browsing this thread: 2 Guest(s)