Object Repository Exercise 2: Learn and Save Multiple Object Repositories – UFT/QTP Training Tutorial 8.2

In UFT/QTP Training series last article “Object Repository Exercise 1” we presented that how to create a shared object repository for the Welcome page of the Mercury Tours Web site.

In Object Repository Exercise 2, you will get to know how to create a shared object repository for each of the remaining pages in the site. Here, UFT will learn all of the objects on each page, it is not require for you to associate the object repositories with a specific action.

Let us know that how to work on it.

 
First, visit to the Flight Finder page by log-in into the Mercury Tours Web site.

In IE browser, open the URL: “http://newtours.demoaut.com”. The Mercury Tours Web site welcome page will appear, log-in into the site by giving UserName and Password. Once log-in process done, the Flight Finder page appears.

Object Repository in UFT Excercise 2

Second, generate a new shared object repository.

If the Object Repository Manager is not opened, open it by visiting Resources > Object Repository Manager in UFT. The Object Repository Manager window opens. Once the Object Repository Manager window opens, click on “New”button to open a blank shared object repository.

 
Third, set the Define Object Filter to open the Navigate and Learn

To open the Navigate and Learn, go to the opened Object Repository Manager window, select Object à Navigate and Learn will hide both UFT and the Object Repository Manager.From the Navigate and Learn toolbar, click the Define Object Filter button. The Define Object Filter dialog box opens.

In the Define Object Filter dialog box displays number of options, select “All object types” option and click “OK”.

UFT Define Object Filter dialog box

Fourth, Learn all objects from the Flight Finder page.

Here, UFT will learn all objects of Flight Finder page of the Mercury Tours Web site that match the filter, and those objects to a shared object repository. In the Mercury Tours Web site, refresh the Flight Finder page to bring it into focus for UFT to learn as the Web page.

Next, use Navigate and Learn toolbar and click “Learn” button. Once we click on “Learn” button, the Web page start flickering and the Adding Objects message box displays to represent that UFT has been started adding properties and values of objects of the Web page to a new object repository.

When objects addition done, close the Navigate and Learn toolbar. As soon as we close the Navigate and Learn toolbar, UFT and the Object Repository Manager window becomes visible.

 
Fifth, save the shared object repository by click on “Save”, it opens the “Save Shared Object Repository” dialog box. Save the file by giving name of the file, here we have used the file name “MercuryToursFlightFinder.tsr” and click OK.

To generate a new shared object repository for the Select Flight page.

To create new shared object repository, just go down to the Flight Finder page of Mercury Tours Web site and click on “Continuebutton, it takes you to the Select Flight page. Objects can also be added from this page too.

After setting the Select Flight page, go back to Object Repository Manager window and click “New” button. A blank shared object repository opens.

In the Object Repository Manager window, select Object > Navigate and Learn. The Navigate and Learn toolbar opens that hides both UFT and the Object Repository Manager.

Next, go back to the Select Flight page,refresh the page to bring it into focus for UFT to learn as the Web page.

Sixth, generate object repositories for the remaining objects of Web pages.

Using above process, create new shared object repositories for each of the following pages:

  • Book a Flight
  • Flight Confirmation

After creating shared object repositories for both “Book a Flight” and “Flight Confirmation” page. Save “Book a Flight” by giving name “MercuryToursBookFlight.tsr” and Flight Confirmation” by giving name “MercuryToursFlightConfirmation.tsr”.

 
Seventh, involve the MercuryToursFlightFinder.tsr object repository with the Flight Finder action.

To do so, go back to the UFT window and open Solution Explorer window. In Solution Explorer window, right-click to the “Flight Finder” action and choose“Associate Repository with Action” from the context menu. The Open Shared Object Repository dialog box opens.

Choose the “MercuryToursFlight Finder.tsr shared object repository and click Open.

Next, the “Automatic Relative Path Conversation” message box opens, click on “Yes” for further process.

In the Solution Explorer window, you can see the object repository (MercuryToursFlightFinder) at the bottom of the Flight Finder action, as a child of that action.

UFT Object Repository
UFT Object Repository2

Eight, just like above mention process, involve the “MercuryToursSelectFlight.tsrobject repository with the SelectFlight action, and “MercuryToursBookFlight.tsr” and “MercuryToursFlightConfirmation.tsr” withBookFlight action.Shown in the figure below.
 

 

Later, when you add steps to each action, all of the vital test objects will be open for use.

 
Ninth, save the test by clicking on “Save” button.

Conclusion:

Today we have learned about how Save Multiple Object Repositories. In next UFT/QTP Training Tutorial 9 we will see “UFT Functions and Function Libraries“.


⇓ Subscribe Us ⇓


If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:


 

Check email in your inbox for confirmation to get latest updates Software Testing for free.


  Happy Testing!!!
 

Leave a Comment

Share This Post