Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling Object Repositories dynamically inside For Loop
#3
Not Solved
Code:
Dim obj_rep, obj_col, repository_no, obj_count

For repository_no = 1 to 10

Set obj_rep = CreateObject("Mercury.ObjectRepositoryUtil")
obj_rep.Load obj_repository_file_path & current_screen & ".tsr"

Set obj_col = obj_rep.GetAllObjects()
obj_count = obj_col.Count
Print obj_count

Set obj_col = Nothing
Set obj_rep = Nothing

Next


When I run the above script, only once the obj_count is getting printed. The obj_count for remaining 9 repositories are not printed.
How to overcome this?

obj_repository_file_path - would be taken from environment file.
current_screen - would be taken from the OR folder at run time based on a condition.
Reply


Messages In This Thread
RE: Handling Object Repositories dynamically inside For Loop - by danny2012 - 07-12-2012, 04:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Difference between error handling and exception handling venkatbatchu 6 26,641 12-11-2018, 05:11 PM
Last Post: smitapawar610
  SAPLIST is not recognised inside SAPTable mann 0 1,250 02-26-2018, 11:24 AM
Last Post: mann
  UFT - Check a checkbox inside a table cell sara- 0 5,711 02-02-2015, 08:07 PM
Last Post: sara-
  Declaring Extern in QTP to call a DDE function inside a DLL **SOLVED** ramuk 1 3,444 06-07-2012, 07:57 PM
Last Post: ramuk
Exclamation Objects inside Pop up window not recognised. falvi 12 10,698 04-12-2012, 11:26 AM
Last Post: falvi

Forum Jump:


Users browsing this thread: 1 Guest(s)