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.
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”.
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 “Continue” button, 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.
Eight, just like above mention process, involve the “MercuryToursSelectFlight.tsr”object 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:
Happy Testing!!!
Other Tutorial Series
- Object Repository Exercise 1: Learn and Save Objects of a web application – UFT/QTP Training Tutorial 8.1
- Object Repository in UFT – How UFT identify the objects uniquely? – UFT/QTP Training Tutorial 8
- Overview of HP Unified Functional Testing 12.0 – UFT/QTP Training Tutorial 3
- Type of Testing in Unified Functional Testing (UFT) 12.0 – UFT/QTP Training Tutorial 6
- Add steps on Login action in keyboard View – UFT/QTP Training Tutorial 10
- Exercise3: Add Steps to the BookFlight Action Using the Step Generator – UFT/QTP Training Tutorial 10.2
- Brief Overview of Keyword View – UFT/QTP Training Tutorial 11
- UTF 12.0 First Look After Installation – UFT/QTP Training Tutorial 4
- UFT Functions and Function Libraries – UFT/QTP Training Tutorial 9
- Exercise2: Brief explanation of how Keyword view works – UFT/QTP Training Tutorial 11.3