When a script is recorded, an object repository is created. If two separate scripts are recorded that act upon the same page, two object repositories are created that differ only in the name of the folder/page which contains the objects; provided that you clicked on the same objects during each recording. See the attached screen shot for an example.
Is there a way to indicate that, during a recording session, a script should use existing objects so as to avoid duplication? I know that I could go back through a script after a recording session and substitute the folder/page name such that both scripts operate off of the same source but this is labor intensive.
If there is not a way to reuse an object map among multiple scripts during a record session, is there a way to merge existing object repositories then find and replace page names, etc., in scripts so that one common object repository exists per page?
Reuse Object Repository.png
I can’t believe no one answered this!
it’s very annoying to create an object repository for every single page.
I ended up using Windows Explorer to move objects into the proper folder and deleting the duplicate, as a work around. It adds time to the workflow, but until this is fixed, I think it is worth it.
Any official response to this? This is very annoying and seems like such a basic thing to get right as it is an integral part of the Automation test case creation work flow.
It is always a best practice to use a single entry in your repository for the same object (i.e. avoid duplicates for the same object). Test repo and scripts will be clean and maintenance will be easier. You can easily right click and delete the duplicates (folder/objects) and edit your script and point your test case steps to the correct objects.
If you already have the objects, then you could not use the recorder. I find manual step additions (and scripting) to be much more reliable and under your own control. You can uncheck to not create a new folder - http://forum.katalon.com/discussion/6511/save-page-objects-without-a-new-folder#latest and I think it only updates objects then instead of creating new one if they already exist, but you would have to try it. I agree the object repo could do with improvement.