RSS Feed

How to add object repository in qtp

Posted on

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)

Procedure to add object repository in qtp during run time:

Just write following lines of code in your script.
——————————————————————————–

Dim qtApp

Set qtApp = CreateObject(“QuickTest.Application”)

qtApp.Test.Actions(1).ObjectRepositories.Add “C:\Repository1.tsr”
———————————————————————————

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: