Saturday 16 August 2014

QTP Business Process Testing




Business Process Testing is a role-based testing model. It enables non-technical Subject Matter Experts (working in Quality Center) to collaborate effectively with Test Automation Engineers (working in QuickTest Professional). Together, you can build and run business process tests, without requiring programming knowledge on the part of the Subject Matter Expert

Subject Matter Experts understand the various parts of the application being tested, as well as the business processes that need to be tested, however they may not necessarily have the programming knowledge needed to create automated tests

Automation Engineers are experts in Test Automation. They use QuickTest to define the resources and settings needed to create components, which are the building blocks of business process tests.


Integration between QuickTest and Quality Center enables the Automation Engineer to effectively create and maintain the required resources and settings, while enabling Subject Matter Experts to create and implement business process tests in a script-free environment, without the need for programming knowledge.
                                                         



It is the collection of resources and settings that are used for the creation and implementation of business components. These include function libraries, shared object repositories, keywords, testing preferences, and other testing resources, such as recovery scenarios.



It’s the place which is used to create, populate, and maintain shared object repository files that are used by QuickTest to identify the objects in the application. It is allowed to define and modify test object information in shared object repositories using the QuickTest Object Repository Manager. After associating shared object repository files with the application area, can prioritize them according to relevance. By associating a shared object repository with an application area, any component based on that application area will have access to all of its test objects and other elements.

Each object repository contains the information that enables QuickTest to identify the objects in your application. QuickTest enables to maintain the reusability of the components by storing all the information regarding the test objects in a shared object repository. When objects in an application change, the Object Repository Manager provides a single, central location in which we can update test object information for multiple components

The same shared object repository can be used with multiple components. Also use multiple object repositories within each component. In addition, objects can be saved directly with a component in a local object repository. This enables to be accessed only from that component.

If one or more of the property values of an object in your application differ from the property values QuickTest uses to identify the object, the component may fail. Therefore, when the property values of objects in an application change, should modify the corresponding test object property values in the corresponding object repository so that you can continue to use the existing components. Can modify objects in a shared object repository using the Object Repository Manager, as described in this section


We can create function libraries that contain functions, or operations (also known as keywords), that can be called by a component. These functions contain programming logic that encapsulates the steps needed to perform a particular task, and they enhance the functionality of the component that calls them. We can use QuickTest to create these function libraries. We can also use the QuickTest Function Definition Generator to insert basic function definitions, and then complete each function by adding its code.

After associating function library files with an application area, can prioritize them according to relevance. By associating a function library with an application area, any component based on that application area will have access to all public functions defined within that function library.


Unexpected events, errors, and application crashes during a run time can disrupt your run session and distort results. This is a problem particularly when tests run unattended—the test pauses until you perform the operation needed to recover. To handle situations such as these, QuickTest enables you to create recovery scenarios and associate them with application areas. Recovery scenarios activate specific recovery operations when trigger events occur.


Components are easily-maintained, reusable units that perform a specific task. They are the building blocks of business process tests. Each component is comprised of several application steps that are logically performed together in a specific order. By design, each component tests a specific part of an application. When combined, components are incorporated into a business process test in a serial flow representing the main tasks performed within a particular business process. Due to the modularity and reusability of components, they can be used in multiple business process tests


There are 2 types of components
*       Business Components
*       Scripted Components


Business components (also known as keyword-driven components) are fully integrated with both QuickTest and Quality Center, enabling both you and Subject Matter Experts to create, modify, and run them. It has only Keyword view in Quick Test Professional
In the Keyword View, business components are divided into steps in a modular, keyword-driven, table format. Each step is a row that comprises individual parts that you can easily modify. You create and modify steps by selecting items and operations and entering additional information, as required.

1.2.1.2.      Scripted Components

Scripted components have both views such as Keyword view and Expert view in Quick Test Professional. You can also incorporate user-defined functions in the scripted component steps, parameterize selected items, and add checkpoints and output values to the scripted component.

Subject Matter Experts working in Quality Center can then include these scripted components in business process tests to check that the application behaves as expected.

After creating a scripted component, Subject Matter Experts can view the auto-documentation generated by the component (read-only) in the Business Components module of the Quality Center project. They can run the scripted component and add it to their business process tests, but one remain responsible for maintaining the scripted component in Quick Test.


*       You can utilize the full power of both the Keyword View and the Expert View
*       Using the Expert View, you can enhance the scripted Component flow by manually entering standard VBScript statements
*       If the Application flow is Complex which needs programming logic like addition of loops and conditional statements it can be added where as this is not possible in business component


*       Scripted components cannot be modified in Quality Center
*       Programming Expertise is needed




A scenario comprising a serial flow of business components, designed to test a specific business process/test case of an application.




Below are the steps to be followed to create a Business Component

1.    Connect to QC from QTP
2.    Creation of Object Repository in QTP
3.    Creation of Recovery Scenarios in QTP
4.    Creation of Function Library in QTP
5.    Creation of Application Area in QTP
a.    Associate Recovery Scenarios
b.    Associate Function Libraries
c.    Associate Shared Object Repositories
6.    Creation of Business Component in QTP




Below are the steps to be followed to connect to QC from QTP.

*  Launch QTP by clicking QTPro.exe file
*  File -> Connect to Quality Center or Click on this icon  from toolbar
*  Click on Connect button in Quality Center Connection window. Below is the screenshot detail



*  Enter user id and password and then click on login button
*  Select Domain and Project from the list box
*  We can check the QC connection status from QTP status bar


*       Select Object repository manager from Resources -> Object repository manager.
*       To add object in the repository manager Object -> Add Objects from the repository manager or Click on  button
*       After clicking on the  button and application will highlighted  with hand signal
*       Save the repository either of the following ways File -> Save in Object Repository manager or Click on Save button or Ctrl + S









*       Select Recovery Scenario Manager from Resources -> Recovery Scenario Manager
Click on   button to create new scenario


*                   Click on Next button from Recovery Scenario Wizard


*                   Select any one of the trigger event type option from the available options

*                   Specify Pop-Up Window conditions by clicking on hand signal button to identify the pop up window. It will capture the Popup window title and window text


*                   Select Recovery Operation to perform when the trigger event occurs




              



*                   Select Add another recovery operation to add another operation ( If required )



*                   Select the post recovery operation when the recovery operation is complete



*                   Provide scenario name and description and then click on next button.






*                   Select Add scenario to default test settings and then click on finish button
*                   Click on save button to save the recovery scenario.







Create new application area from the following path
File -> New -> Application Area or Press Ctrl + Alt + N.


*       Enter application area description in general tab.
*       Click on  Modify button to modify the associated Addins ( If required)
*       Click on Additional Settings button to define Recovery Scenarios and application details.





*       Click on Recovery tab from Application area settings window
*       Click on  button and it will open Add recovery scenario window
*       Click on  button from Add recovery scenario window. It will open attachment from Quality center project there we can add recovery scenarios to the application area.




*       After selecting recovery scenario click on Add Scenario button from Add recovery scenario window.
*       Select On Error option from Activate recovery scenarios list box Once you associated the recovery scenarios Click on Apply and then Ok button.



*       Click on function libraries tab to associate function libraries to the application area. We can see the already associated common libraries.
*       Click on  button it will add an empty row with this  button in Associated Function Libraries frame
*       Click on  button to add user defined function library and it will open Add function Library window



* Click on function libraries tab to associate function libraries to the application area. We can see the already associated common libraries.
* Click on  button it will add an empty row with this  button in Associated Function Libraries frame.
* Click on  button to add user defined function library and it will open Add function Library window
* Save the application area from File ->Save or Click on Save button from the Toolbar.




*       Create new Business Component from the following path File -> New->Scripted Component
*       Select Application area from Existing application areas list to create business component and associate with it

Different Views
Coding can be done is 2 views.
*       Expert View
*       Keyword View



Expert View

Keyword View




Below are the steps to be followed for creating Business Components in QC.


*       After creating scripted components in QTP the component status will be showed as under development and the component icon   in Quality Center.
*       We can change the status of the component by Selecting the ready status from Status list box  from details tab or right click on the component and select the ready status and component icon  in quality center




*       We can create input and output parameters for a business component using parameters tab


*       Click on new button in the input frame to add input parameter. We can add the parameter value type, default value and description. In same way we can add output parameters also.
*       Parameter naming conventions  input parameter – p_In_parameter1,output parameter – p_Out_parameter1






*       Click on  button in the test plan tab to create a new business process test
*       Select Test type as BUSINESS-PROCESS and give the test name and then click on button.



*       A new test added in the left pane of the test plan tab
*       Click on Test Script tab to add business components for the test
*       Select the required components in an order from the Component list pane and then click on  button to move the component for the test.
*       We can give the values for input parameters in Test level and we can use the output value of the pervious component as input for the next components.




*       Select the Output of previous component option from parameter window


*       Select the required output parameter to use as input parameter




Before start execution from QC center we need to check the following setting in QTP
*       Go to  Tools -> Options
*       Select Run tab
*       Check the check box Allow other mercury products to run tests and components
*       Click on ok button


*       Click on  button to run the test from test plan


*       We can specify the run mode of each business component either Normal or Debug mode from Run Or Debug test window and then click ok button



*       QTP will launch first and then component will be opened and executed in a order
*       Once test is completed Result window will be opened.




*       Click on  button in test lab tab to create a new test set
*       Give Test set name and description then click on ok button. A new test set will be added in the left pane of test lab tab
*       Select the required tests from the tests list pane and then click on  button to add it in a test set
*       Enter planned execution date and planned finish date then click on button
*       Click on Run button from test lab right pane
*       To Run the tests in local host check the Run All tests locally check box else specify the host where the test need to run
*       To Run all selected tests Click on Run All button else select the test then click on Run button










In Order to view Test results in QC we need to install Quick Test Professional Add-in from Quality Center Add-In page

*       Double click on test to see the report of all runs
*       Select the Run name and then click on status link to view test report









0 comments :

Post a Comment