distributedlife

passionate about everything

QuickTest : Applying major changes to a repository Published by Ryan Boucher @ 3:09 pm
There are times when major changes need to be applied to a repository. Such an example is when a deployed application is moved from a local test server to a server in a pre-production environment. Nothing should change except for the URL, which unfortunately is hard-coded into every single object in your repository.
  1. Open Object Repository Manager [Resources > Object Repository Manager]
  2. Open your project repository [File > Open] Export to XML [File > Export to XML]
  3. Enter a filename [exported.xml]
  4. [ok]
  5. Open you’re favourite XML editor (i.e. Notepad++)
  6. Find and Replace on the current path to the new path
  7. Do any other maintenance work
  8. [Save xml-doc]
  9. ensure document is well-formed
  10. [Close xml-doc]
  11. Meanwhile… Back in Object Repository Manager
  12. Import from XML [File > Import from XML]
  13. Save your Imported repository [imported.tsr]
  14. In the file system, delete repository.tsr and exported.xml
  15. Rename: imported.tsr to repository.tsr
Note: You will need to open a different QuickTest project and then reopen your current project for the results of the merge to be visible in the Object Repository. It’s a pain, but that’s the way of things.
My Mug Ryan Boucher is a Software Inquisitor and is passionate about it. You can find a whole raft of articles and anecdotes about software testing and other topics he gets excited about.
Tags

2 Responses to “QuickTest : Applying major changes to a repository”

  1. April 12th, 2008 at 2:20 am Anonymous:

    Nice tip.

    Remember though that object properties can be defined using regular expressions.

    So, instead of doing this each time for an environment shift, do it once with regular expressions defining the variety of environment urls or even better do it when your creating the objects.
    eg:
    http://URL1|http://URL2|http://URL3

  2. April 13th, 2008 at 8:34 am Chad Stone:

    Cheers, I hadn’t thought of that. I love regex.