SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Help with ObjectRepositoryUil

    Hey Ya'll. I usually don't come to forums and ask for help (I like to figure things out on my own!) but I'm completely stumped on this one. What I'm trying to do is load a repository at runtime so I can do some checks against the objects in the repository. I don't actually want to modify the repository at all, just do some simple checks.

    Now, according to Mercury (HP) I have to use CreateObject("Mercury.ObjectRepositoryUil") which I did without a hitch. The problem I'm running into is when I try to load a repository. I keep getting a "Load - General Error" message. The error message is really descriptive! *roll eyes* Anyways, can someone here maybe point me in the right direction of what I'm doing wrong? I'd really appreciate any help I can get, thanks in advance!

    Here's a little snip of code:
    <font class="small">Code:</font><hr /><pre>Set Repository = CreateObject("Mercury.ObjectRepositoryUtil")
    Repository.Load "C:\Tests\Repositories\BaseTables.tsr" 'Test fails here, and yes the file exists
    Set ObjectList = Repository.GetObjectsByClass("Link") </pre><hr />

    I'm using QuickTest Pro 9.1 [img]/images/graemlins/smile.gif[/img]

  2. #2
    Senior Member
    Join Date
    Feb 2007
    Location
    Pittsburgh, USA
    Posts
    429
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with ObjectRepositoryUil

    Try this:

    Set Repository = CreateObject("Mercury.ObjectRepositoryUtil")

    Var=Repository.Find "C:\Tests\Repositories\BaseTables.tsr" 'Test fails here, and yes the file exists
    If Var &lt;&gt;-1 Then
    Repository.Remove(Var)
    End If
    Repository.Add("C:\Tests\Repositories\BaseTables.t sr")
    -Reddy

  3. #3
    Junior Member
    Join Date
    May 2007
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with ObjectRepositoryUil

    Thanks TmReddy but that doesn't seem to work. QTP is telling me that the Repository object does not contain the Find, Remove and Add functions.

    You would think something like this would be simple. I just want to iterate through all the objects in my repository to do a simple check on 'em [img]/images/graemlins/frown.gif[/img]

  4. #4
    Senior Member
    Join Date
    Feb 2007
    Location
    Pittsburgh, USA
    Posts
    429
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with ObjectRepositoryUil

    What version of QTP you are using?
    -Reddy

  5. #5
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with ObjectRepositoryUil

    Just a W.A.G. here, but is it possible that "Repository" is a reserved word?

    Try this:

    Set MyRepositoryObject = CreateObject("Mercury.ObjectRepositoryUtil")
    MyRepositoryObject.Load "C:\Tests\Repositories\BaseTables.tsr"
    ObjectList = MyRepositoryObject.GetObjectsByClass("Link")
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  6. #6
    Junior Member
    Join Date
    May 2007
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with ObjectRepositoryUil

    Actually, I just got it working [img]/images/graemlins/smile.gif[/img] Apparently the testing machine does not have admin rights (Why, I don't know?) and apparently QuickTest Pro won't let me load a file without admin rights.. I gave the account I was using admin rights and now everything works great.

    Stupid little quarks like that get on my nerves! Thanks all for the help though [img]/images/graemlins/smile.gif[/img]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:51 PM.

Copyright BetaSoft Inc.