Automation Testing Tutorial | Multiple Object Repositories

Multiple Object Repositories

It is recommended to always create a separate shared object repository for each page in your Web site or each area of your application. This makes it easier to find the correct object when adding or modifying test steps or when performing maintenance tasks when objects are added, removed, or modified in your application.

For the purposes of this example, you will instruct QuickTest to learn all of the objects on each page. At this point, you do not need to associate the object repositories with a specific action.

  • If it is not still open, log in to the Mercury Tours Web site.
    • Open Internet Explorer and browse to the Mercury Tours Web site: http://newtours.demoaut.com
    • In the User Name and Password boxes, type tutorial.
    • Click Sign-In. The Flight Finder page opens.
  • Create a new shared object repository.
    • If the Object Repository Manager is closed, open it by choosing Resources > Object Repository Manager in QuickTest. The Object Repository Manager window opens.
    • In the Object Repository Manager window, choose File > New. A blank shared object repository opens.
  • Start the Navigate and Learn process by setting up the Define Object Filter.
    • In the Object Repository Manager window, choose Object > Navigate and Learn. Both QuickTest and the Object Repository Manager are hidden.
    • In 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, select All object types and click OK.
  • In this step, you instruct QuickTest to learn all of the objects in the Mercury Tours Web site Flight Finder page that match your filter and to add them to a shared object repository.
    • Click the Find a Flight page title bar to change the focus from the Navigate and Learn toolbar to the Web page you want QuickTest to learn.
    • In the Navigate and Learn toolbar, click the Learn button. The Web page flickers and the Adding Objects message box is displayed as QuickTest begins adding representations of the objects on the Web page to a new object repository. Adding these objects takes a few seconds. Do not interact with the Web page while Navigate and Learn runs.
    • In the Navigate and Learn toolbar, click the Close button. The Navigate and Learn toolbar closes, and QuickTest and the Object Repository Manager window are visible again.
  • Save the shared object repository.
    • In the Object Repository Manager window, choose File > Save or click the Save button. The Save Shared Object Repository dialog box opens.
    • Browse to the Tutorial_ObjectRepositories folders and select it. In the File Name box, enter MercuryToursFlightFinder and click Save.
  • Create a new shared object repository, add objects to it, and save the repository.
    • In the Flight Finder page, click Continue. The Select Flight page opens. You are now ready to add objects from this page.
    • Switch to the Object Repository Manager window and choose File > New. A blank shared object repository opens.
    • In the Object Repository Manager window, choose Object > Navigate and Learn. Both QuickTest and the Object Repository Manager are hidden.
    • Click the Select Flight page title bar to change the focus from the Navigate and Learn toolbar to the Web page you want QuickTest to learn.
    • In the Navigate and Learn toolbar, click the Learn button. The Web page flickers and the Adding Objects message box is displayed as QuickTest begins adding representations of the objects on the Web page to a new object repository. Adding these objects takes a few seconds. Do not interact with the Web page while Navigate and Learn runs.
    • In the Navigate and Learn toolbar, click the Close button. The Navigate and Learn toolbar closes, and QuickTest and the Object Repository Manager window are visible again.
    • In the Object Repository Manager window, choose File > Save or click the Save button. The Save Shared Object Repository dialog box opens.
    • Browse to the Tutorial_ObjectRepositories folder and select it. In the File Name box, enter MercuryToursSelectFlight and click Save.
  • Create new shared object repositories for each of the remaining Web pages.
    • Repeat above step to create shared object repositories for the following pages:
      • Book a Flight
      • Flight Confirmation
    • Name the object repositories MercuryToursBookFlight and MercuryToursFlightConfirmation, respectively.
  • Associate the MercuryToursFlightFinder.tsr object repository with the FlightFinder action.
    • Switch to QuickTest and open the Resources pane, if it is not already open, by choosing View > Resources or clicking the Resources Pane button .
    • In the Resources pane, right-click the FlightFinder action and choose Associate Repository with Action. The Open Shared Object Repository dialog box opens.
    • Locate and select the MercuryToursFlightFinder.tsr shared object repository and click Open. The object repository is now associated with the FlightFinder action, and is displayed in the Resources pane as a child of that action.
  • Associate the remaining object repositories with the relevant actions. Repeat above step and:
    • Associate MercuryToursSelectFlight.tsr with the SelectFlight action.
    • Associate the following repositories with the BookFlight action:
      • tsr
      • tsr

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

  • Save your test. Choose File > Save or click the Save button.

Test Your Automation Testing Skills By Taking Our Free Practice Tests On This Link

Share this post
[social_warfare]
Automation Testing Tutorial | Object Spy
Automation Testing Tutorial | Actions Basics

Get industry recognized certification – Contact us

keyboard_arrow_up