How to add object repository in qtp
Hi friends, I got very good response from you on my previous post “object repository in qtp”. So today also I am going to give you some advance knowledge in context to object repository in QTP.
I am going to teach you two following things in context to object repository.
1. How to add object repository in qtp manually.
2. How to add or load object repository in qtp during runtime.
Procedure to add object repository in qtp manually
1. Go to Edit->Action->Action Properties window.
2. Than switch to “Associated Repositories” Tab.
3. Click on “+” sign.
4. Now click on right most side button and add object repository file (in .tsr format)
Note: If you don’t know how to export object repository in .tsr file. Please refer 6th question of this post: QTP FAQS with answers part- 2
Procedure to add object repository in qtp during run time:
Just write following lines of code in your script.
Set qtApp = CreateObject(“QuickTest.Application”)
Note: Above script will add “Repository1.tsr” file to your test during run time. Please note that this object repository file will be loaded during run time so you can see it attached only during run time. During stop mode you will not be able to see attached object repository.
If you want to verify that object repository is added or not during runtime you can verify. When your script is in running mode just Go to Debug->Pause and then you can verify by going to Edit->Action->Action Properties and then associated repository tab.
So Enjoy Learning and let me know if you face any kind of difficulty. You are always welcome to share your feedback on this post “how to add object repository in qtp”.