SlideShare a Scribd company logo
Automation Fundamental Concepts and  Intro. about QTP 9.2
Automation Fundamental Concepts What is Test Automation ?  Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time… When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation… Automation helps to avoid human errors and also expedite the testing process… To implement the Test Automation detailed planning and effort is required
Automation Fundamental Concepts Automation saves time and effort which results in reduction of the Test life cycle… Benefits of Automation - Consistency of Test Execution - Reducing cycle time of regression test cycles - Data driven testing - Repeatability - Coverage - Reliability - Reusability of test wares
Automation Fundamental Concepts Automation life cycle is a subset of the entire test life cycle… Automation planning can be initiated in parallel to the test planning phase… Factors to be considered in automation planning, Stability of AUT (Application under test) No of regression cycles to be performed Compatibility of App platform with testing tools Cost benefit analysis (ROI) Availability of skilled resources
Regression Testing & Automation When Automation is applicable? Regression Testing Cycles are long and iterative. If the application is planned to have multiple releases / builds If it’s a long running application where in small enhancements  / Bug Fixes keeps happening Test Repeatability is required
Technologies Supported Default Support   1. Standard Windows applications   2. Web objects / Applications   3. ActiveX controls   4. Visual Basic applications Supported Add-ins   QuickTest Professional Java Add-in 9.1  QuickTest Professional .NET Add-in 9.2  QuickTest Professional Oracle Add-in 8.2  QuickTest Professional PeopleSoft Add-in 8.2* QuickTest Professional Add-in 8.2 for SAP Solutions QuickTest Professional Siebel Add-in 8.0* QuickTest Professional Stingray Add-in 8.2 QuickTest Professional Terminal Emulator Add-in 8.0* QuickTest Professional VisualAge Smalltalk Add-in 8.2 QuickTest Professional Web Services Add-in 9.2
Supported Browsers Microsoft Internet Explorer 6.0 Service Pack 1 Microsoft Internet Explorer 7.0 Netscape Browser 8.1.2 Mozilla Firefox 1.5  Mozilla Firefox 2.0
Add-in Manager Default Add-ins ActiveX Visual basic Web Other Add-Ins Siebel Java SAP Oracle  .Net and many more
Add-in Manager Cont… QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test) Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager. It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro.
Mercury QuickTest Professional Introduction to QTP QuickTest Professional, the Mercury advanced keyword-driven testing solution enables you to test standard Windows applications, Web objects, ActiveX controls, and Visual Basic applications. You can also acquire additional QuickTest add-ins for a number of special environments (such as Java, Oracle, SAP Solutions, .NET Windows and Web Forms, Siebel, PeopleSoft, Web services, and terminal emulator applications).
QuickTest Window The QuickTest window contains the following key elements:  QuickTest title bar —Displays the name of the currently open test or component. Menu bar —Displays menus of QuickTest commands. File toolbar —Contains buttons to assist you in managing your test or component. Testing toolbar —Contains buttons to assist you in the testing process. Debug toolbar —Contains buttons to assist you in debugging your test or component (not displayed by default). Action toolbar —Contains buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Test pane —Contains the Keyword View and Expert View tabs. Active Screen —Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
Continued… Data Table —Assists you in parameterizing your test or component. For a test, the Data Table contains the  Global  tab and a tab for each action. For a component, the Data Table contains single tab. Debug Viewer pane —Assists you in debugging your test or component. The Debug Viewer pane contains the  Watch Expressions ,  Variables , and  Command  tabs (not displayed by default). Status bar —Displays the status of the QuickTest application.
QTP Window
1. Prepare to Record Objectives Review documented user steps of a business transaction. Understand the application under test and its environment. Prepare the test environment to utilize QuickTest Professional correctly.
Quick Test Professional - Record & Run Modes Recording Modes Normal Analog Low level Run Modes Normal Fast Update
Quick Test Professional  -Tools    Options    General Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed.
QuickTest Professional Options->General A best practice when setting general options for QuickTest are to: Deselect all check boxes except “Save data for integrating with performance testing …” and “Display Add-in Manager on startup”. Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed.
Quick Test Professional  - Tools    Options    Run
Quick Test Professional  - Options    Run Best Practices for Options for Run Mode: Run Mode as Normal:  This ensures that the execution arrow appears to help with trouble shooting the tests. Synchronization becomes better for the AUT (Application Under Test) Test Results:  Deselect the option “View Results when run session ends”  Mercury Tool Integration:  Select "Allow other Mercury products to run tests and components“ Screen Capture:  Save step screen capture to results "On error and warnings"
Automation    Record and Run Settings
Record and Run Settings Best Practices for Record & Run Settings Set the options to configure QTP to "Record and run test on any open Windows- based application“ Set the option - This window will appear the first time you click on the Record button in the new test. Manually recall this window by selecting Automation  Record and Run settings
QTP - Main Window
QTP - Main Window Test Pane: Test Pane contains two labs to view the tests,  - Keyword View  - Expert View Keyword View:  Quick Test Pro displays your test in the form of a collapsible, icon based tree… Expert View: Quick Test Pro displays the source code (VB Script) of the tests in this view.
2. Create a Test Objectives Create a basic test from a manual test case. Run a test and check for errors. Store the test file. Discuss the importance of initial and end conditions.
The User Interface The QuickTest Professional user interface is broken up into a number of functional areas. You can choose to focus on one or more areas depending on the task you are performing.
Record a Test Once the record button is pressed and test steps are performed , QuickTest listens and records the activities. This results in the recording and storing of each step of the business process. Each step consists of: The object The method (operation) The method property (a value for the action performed on the object) QuickTest should be running before the application under test is invoked. For some environments, this is mandatory.
Saving a Test Saving the test in Quality Center Only relevant when using QTP with QC A bulls-eye symbol in the header with “Open Test from Quality Center” appears A folder structure is listed under the parent directory “Subject” You have the option to click the File System button on the upper right corner Once you have logged into Quality Center: Select your folder Type in the test name Save the file Save a test in QuickTest Professional If you are using QuickTest Professional alone the file system you will save to is under the QuickTest Professional’s test directory. You have the option to save the test results along with the test.
Steps to Run a Test From the QTP Toolbar, click on the Run Button. A best practice is to use the temporary folder to hold the results while debugging your test. Press the OK button to execute the Run command.
Viewing the Test Run When you run a test, QuickTest performs each step as it was recorded. You can watch in the AUT as QuickTest performs each step. A yellow arrow in the left margin of the KEYWORD VIEW points out the step currently running. When QuickTest finishes running the test, you can open the Test Results window.
Steps to View the Results Decide if results must be viewed. If yes, select TEST->RESULTS from the QTP menu bar. View the outcome of the test run. Expand the results tree. From the Test Results menu bar, select  VIEW->EXPAND ALL
View Test Results Failure “roll-up” to the parent at the top level of the tree. Expand the Test Results tree to see the outcome of each step. Navigate to the child step that caused the failure.
3. The Object Repository Objectives Define what a Quick Test Professional object is. Describe the role of the Object repository Identify a given object as part of a class. Describe how objects are recognized by Quick Test Professional. Use the Object Repository to find and add objects. Change object logical names using the Keyword View.
Object Types A Quick Test Professional object is a graphic user element in an application, such as a button or a drop-down list. Objects are categorized into classes. Buttons, Graphic Images and Edit Boxes are a few examples of class types.
QuickTest Object Properties In the example above, there are several objects called Buttons, two of which are: Update Order Delete Order. The only way to distinguish one object from the other of the same class is by the difference in object characteristics. Specific characteristics of an object within QuickTest are called object properties.
QuickTest Recognizes Objects QuickTest uses a method when it learns objects during the recording process. QuickTest first looks at the object you are recording and stores it as a test object, determining its object class. For example, QuickTest might classify the test object as a standard Windows dialog box or a web button. For each object class, QTP has a default set of properties that it always learns. Usually, only a few properties are needed to uniquely identify an object.
Assigning a Logical Name After learning the class and properties of an object, QTP assigns a name to the object. This is known as the object’s logical name. QTP refers to the object in a recorded test by using its logical name. Edit the logical name to make it more descriptive if you wish. The logical name given to an object during recording may be sufficient, but changing a logical name can give clarity to the test and the documentation that is generated.
Stored Test Objects Recorded object properties are stored in QTP’s Object Repository. Each test has its own Object Repository, by default.. These “stored” objects are referred to  as “ Test Objects”. The purpose of a Test Object is to represent application objects in the test. During a test run, QTP uses the Test Object to search for a match in the application during run time.
Steps to change A Logical Name You can change an object’s logical name in the OBJECT REPOSITORY. Right-click on the object at the KEYWORD VIEW level. Choose OBJECT PROPERTIES. Click on the REPOSITORY button.
The Object Properties Dialog Once in the Object repository: Right-click the object in the repository tree. Choose RENAME. Type a descriptive name for the object. Click OK.
QuickTest Documentation QuickTest updates the object name and documents it in the documentation field of  the Keyword View. IMPORTANT: if you start a brand new test, the test will record the original, default object names in the Object Repository.
4. Synchronization Objectives Define Synchronization. Examine when and where synchronization is most helpful. Add a synchronization step for a specified object.
What is Synchronization ? Synchronization is a step added to a test that instructs QuickTest to wait for the state of a property on a particular object to change before proceeding to the next step in the test. This is done while in RECORD mode. The user/test waits for a visual indication that a step has completed so that the user/test can take the next step.
Some Visual Cue Examples A progress bar reaches 100% completion. A status message appears. A button becomes enabled. A window opens and is ready for data entry. A pop-up message appears in response to an operation.
Examine the Application Quick Test defaults to allocating the same amount of time for every object. Wait times often occur before an object becomes available for the next step. For example, in the Flights application, once the Insert Order button has been clicked, a process bar must complete to yield the Order No. associated with the reservation. The process bar may require additional time before the test can proceed. If insufficient time is allocated for these special circumstances, the test may fail. The error message “Object not enabled” appears if QuickTest is running a test and proceeds to the next step before the previous step has fully processed.
Add a Synchronization Step While Recording Synchronization points which instruct QuickTest to pause until an object property achieves a specific value.The easiest method is to add a synchronization point while recording. A Synchronization step can be added manually after a test is recorded , as well. Always add the synchronization point immediately after the step to be synchronized. From the QTP menu bar, choose INSERT   STEP   SYNCHRONIZATION POINT
Resources    Object Repository Can add a New Object to the repository More properties for recognizing the object can be added to the list. The value of property can be edited here.
Resources    Object Repository Manager
Resources    Associate Repositories Add shared Repository
Resources    Object Repository Associate repository is added to the Filter option.
Object Repository    Merging tool Secondary Repository Primary Repository .
Object Repository    Comparison Tool Comparing two repositories'
Synchronization Synchronization point enables the anticipated time problems between the application and QTP. A progress bar reaches 100% completion. A status message appears. A button becomes enabled. A window opens and is ready for data entry. A pop-up message appears in response to an operation.
How to synchronize the Test We can synchronize the test by  1.Inserting a synchronization point Insert    Step    Synchronization point Window(“Flights”).WinButton(“Update order”).WaitProperty”enabled”,1,1000 2.Adding Exist and Wait statements status=Window(“Flights”).Dialog(“Flights Table”).Exist Wait(10)
Checkpoints A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. We can Insert checkpoint 1.From Menu Insert    Checkpoint    Standard Checkpoint 2.From Keyword view 3.From the Active Screen
Checkpoint Types 1.Standard Checkpoint 2.Image Checkpoint 3.Table Checkpoint 4.Page Checkpoint 5.Text Checkpoint 6.Text Area Checkpoint 7.Bitmap Checkpoint 8.Database Checkpoint
Insert A Checkpoint From The Active Screen A checkpoint can be added after a test is created. Use the Active Screen to select the field on which the checkpoint will be added. Right-click on the appropriate field and choose “Insert Standard Checkpoint”.
Regular Expressions Regular expressions enable Quick Test to Identify Objects and text strings with varying values.
Use a Regular Expression A regular expression is a string that specifies a complex search phrase. By using special characters you define the conditions of the search. Note: There are 4 steps to ensure that a regular expression is inserted correctly. From the Checkpoint Properties window, ensure Constant is enabled and click on the note paper icon. Check Regular Expression checkbox. If  QTP sees there are characters that can be misconstrued as a regular expression, it will ask you to treat it as a literal character. Generally, you will answer No. Add the regular expression. For example, Figure 6-6 will use [A-Z a-z]+.
Parameters Objectives Describe and use multiple parameter types. Drive data in multiple iterations. Analyze errors during iterations. Parameterize a checkpoint.
Input Parameters For Data driven Tests Input Parameters For Data Driven Tests A data-driven test is one that runs a set of user actions with multiple input values. Data driving allows one script to test application functionality with many sets of data. Automated data driven testing frees you to perform more tests, thus increasing test coverage. Speed, repeatability, free resources to do other kinds of quality control.
Input Parameter Input Parameters allow you to replace a static, recorded value in a step with a dynamic placeholder (parameter), which represents an expandable range of values. Input parameter names and their values are located in QuickTest’s Data Table. Input parameter values are input into the application from some outside data source.
Steps to Create An Input Parameter To create an input data table parameter: Select the step in the Keyword View that contains the recorded input value. From the Value column, click on the current value. Click on the parameterize button. The Constant  value appears in the Value Configuration Options dialog box.
Set the Parameter Value In the VALUE CONFIGURATION OPTIONS dialog, select the Parameter radio button and ensure that Data Table is selected from the drop-down list. From the Name drop down list, enter a unique column name to create a new column in your data table or choose an existing column name from the data table. Use the default Global data sheet to store values. Enter the values that QTP will input after the test executes.
Supply Data to the Parameter The design-time table is the central location for storing input parameter values. The number of rows in the data table will cause the same number of test execution iterations to be run. As a default, the design-time data table is displayed at the bottom of the QuickTest screen. If you want to show or hide the data sheet, click on the icon in the toolbar.
Verify The Test Run View the Test Results window to verify that each of the rows from the Design Time Data Table was used during the test run. Expand the tree for each iteration (Row#) to view specific information about the execution of the specific row.
Parameterize a Checkpoint You can use parameterized expected values to make your checkpoints dynamic. They Can be set on: An object property in the Object Repository. A checkpoint on a parameterized field.
A Test with Multiple Actions Actions can be divided into logical sections, like the main sections of a transaction, or by specific business processes. When you create a new test, it contains one action. By dividing your tests into multiple actions, you can design more modular and efficient tests.
Types of Actions There are two kinds of actions: Regular (Non-reusable) Reusable  Tests that contain reusable actions can be used: Locally Externally
Insert Call to a New Action You can add a new action during or after recording. Select Insert ? New Action from the QuickTest main menu. The Insert New Action window appears. Or use the “lego” icon on the toolbar to insert new action.
Using Parameterized Data Test data can be passed from one test to another test using the value of an input parameter. This creates a data flow between business processes. The value passed from one business process to another will come from the Data Table. Be aware of any data dependencies that occur within the business process.
Copied, Existing or New Action After reusable actions are created, they can be called into a “Main Calling” test in three ways: Call to New Action Call to Copy of Action Call to Existing Action
Set Actions as Reusable Create a reusable action from the Action properties dialog. Check the checkbox and click OK. A message will appear stating a description of a reusable action.
Call An Action You can do  number of things with a reusable action, such as: Call it multiple times within a test. Call it from other tests. View the components of the action tree (you cannot modify them except in the original script) Insert a call to an external action (the action is inserted in read-only format) as local editable copy use the (read only) data from the original  action Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions.
One Action used Many Times Rather than recording the login process three times in three separate tests, and enhancing this part of the script (with checkpoints and parameterization) separately for each test, you can create an action that logs into the application in one test. Best Practice Inserting calls to existing actions makes it easier to maintain our tests; when an object or procedure in your application changes. It only needs to be updated one time, in the original action.
Set Actions as Reusable Create a reusable action from the Action properties dialog. Check the checkbox and click OK. A message will appear stating a description of a reusable action.
On Action – Two Names Use the Action Properties – General tab to modify the default label. This makes the test easier for others to understand when viewing the test from the Keyword View tree. Right-Click on Action and enter a logical name for the business process.
Call An Action You can do  number of things with a reusable action, such as: Call it multiple times within a test. Call it from other tests. View the components of the action tree (you cannot modify them except in the original script). Insert a call to an external action (the action is inserted in read-only format) - as local editable copy - use the (read only) data from the original action Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions.
External Action Properties An external action is a reusable action created in another test. The external action is inserted into the calling test in a read-only format. Data from the external action’s data sheet can be imported as a local, editable copy or kept as read only. If read-only, the data can only be modified from the original test. After a reusable action is called, you will see the parameters contained in each test appear in the Global or Local sheet depending on where you stored them in the original test.
Action Run Settings Since there are two (or more) tests running, one right after another,  you may need to specify the iteration for each separately. To affect the run settings for a particular action, set them in the Action Call Properties dialog box. Right-Click on the Action label in the Keyword View, and choose Action Call Properties from the list provided.
Defining an Action The Action Properties dialog box enables you to define options for the stored action. You can modify an action name, add or modify an action description, and set an action as reusable.
Passing Values to a Called Action You can also define input and output parameters to be used by the action. These settings apply each time the action is called.
Using an Action Parameter Once parameters have been set in Action Properties, you can tell QuickTest that the parameter type being used is an Action Parameter.
The Test Flow List The Test Flow List: - Changes with the addition of a reusable action. - Enables viewing of the action tree for a selected reusable or external action. The test flow appears when a test is recognized as having called actions in your test. An action tree displays all the details of the selected reusable or external action.
Action Data Structure In the Action data structure, each Action will have its own: Folder with an object repository Local data table sheet Run settings
Multiple Reusable Actions When using multiple, reusable actions, keep the following in mind: Actions can be called or copied from another test. Run settings have to be set per action As a default, all actions in a test use the same shared Object Repository. Parameters and data from the called test are reflected in the calling test An action can be deleted or an action call can be deleted. Position your action calls separately or nest them with other actions.
Delete an Action Because reusable actions can be used throughout your test or test set, when you delete an action, you must decide to delete a specific occurrence of the action and/or all of its calls. A different message appear when you are about to delete a non-reusable action.
Data Table Sheets - Global The Global Data Sheet: Enables you to create a new column or select an existing column in the Global sheet of the Data Table. Inserts or outputs a value from or to current row of the global data sheet  during each global iteration at run-time. Provides a source of values that can be seen and used by any action.
Data Table Sheets - Local When a Local Data Sheet is used: The parameters and data will appear with different tabs in the main calling test’s Data Table. It allows you to iterate reusable actions independently of any other called actions. You will need to link parameters in the “main calling test”
Recovery Scenarios To instruct Quick test to recover from unexpected events and errors that occur in the testing environment during the run session. A Recovery scenario consists of a) Trigger Event b) Recovery Operation c) Post Recovery Run Option
Recovery Scenario Wizard We can create the recovery scenario using recovery scenario wizard. Recovery scenario wizard consists of  a) Define the trigger event that interrupts the run session b) Specifying the recovery operations required to continue c) Choosing a post recovery test run operation d) Specifying a name and description for the recovery scenario e) Specifying whether to associate the recovery scenario to the current test and / or to all new tests.
Recovery Scenario Wizard
Creating Tests without Object Repository We can use programmatic descriptions to perform an operation on an object that is not stored in the Object Repository. Types of Programmatic descriptions a) We can list the set of properties and values that describe the object directly in a test statement. e.g: Dialog(“name:=Login”).WinEdit(“attachedtext:=agentname”).Set”impetus” b) We can add a collection of properties and values to a description object and then enter the description object in the statement. Set myobject=Description.Create() myobject(“attachedtext”).value:=“agentname” myobject(“html tag”).value:=“a” Dialog(“name:=Login”).WinEdit (myobject).Set”impetus”
Interact with Test Objects not stored in the Object Repository You can also instruct QT to perform methods on objects without referring to the object repository without referring to the object’s logical name. To do this you provide QT with a list of properties and values that QT can use to identify the object or objects on which you want to perform a method Enhance TestCases With Descriptive Programming
You can describe an object directly in a test statement by specifying  property   : =  value  pairs describing the object instead of specifying an object’s logical name. Syntax:-  TestObject(“PropertyName1:=PropertyValue”, “…”, “PropertyNameX:=PropertyValueX”) Where “Test Object” is test object class Enter Programmatic Descriptions Directly into Test Statements
PropertyName  is PropertyValue  i.e. the test object property and its value . Each property:= value pair should be separated by commas and quotation marks. For Example: Window(“Text:=Myfile.txt-Notepad”).Move 50,50 If you want to use the same programmatic description several times in one test, you may want to assign the object you create to a variable. For Ex:- Set MyWin := Window(“Text:=Myfile.txt-Notepad”) MyWin.Move 50,50 Contd….
Once we have filled the Properties collection with a set of Property objects (properties and values), you  Can specify the Properties object in place of a logical name in a test  statement. For Ex:-  (Instead of Entering) Window(“Error”).WInbutton(“text:=OK”, “width:=50”).click IF Entered… Set MyDescription= Description.Create() MyDescription(“text”).Value=“OK” MyDescription(“width”).Value=50 Window(“Error”).WinButton(MyDescription).Click Contd….
VB Script basics – Data Types
VB Script basics – Variables & Constants Declaring Variables Naming Restrictions  Scope and Lifetime of Variables Assigning Values to Variables Scalar Variables and Array Variables  Creating Constants
VB Script basics - Operators
VB Script basics – Conditions & Looping Conditional Statements If...Then...Else statement  Select Case statement  Looping Do...Loop: Loops while or until a condition is true.  While...Wend: Loops while a condition is true.  For...Next: Uses a counter to run statements a specified number of times. For each...Next: Repeats a group of statements for each item in a collection or each element of an array.
VB Script basics – Functions
Key areas in QTP About the script structure Actions (Simple, Nested, External, Re-usable) Parameterization (Different Types) Checkpoints (Programmatic Methodology) Descriptive programming Adv. Synchronization points Exception Handling
About the script structure
Actions (Simple, Nested, External, Re-usable) Standalone Actions Nested Actions Integration of Actions (Call from One Action to other) Driver Action (Main Action) Re-usable Actions External Call for Actions
Parameterization Classifications of Parameterization Test and Action Parameters Data Table (Global & Action Specific) Environment variables Random Number
Types of Checkpoints Check that a Web page (or any portion of it) is displayed as expected.  Checks an area of a Web page  or application after capturing  it as a bitmap  Bitmap Checkpoint  Check whether the expected text string is displayed in the expected location on a Web page or dialog box  Checks that a text string is displayed in the appropriate place in a Web page or application window  Text /  Text Area Checkpoint  Check how long a Web page takes to load or if a Web page contains broken links.  Checks the characteristics of a Web page  Page checkpoint  Check that the value in a table cell is correct.  Checks information in a table  Table Checkpoint  Check that the image source file is correct.  Checks the property values of  an image  Image Checkpoint  Check that a radio button is selected.  Checks values of an object’s properties  Standard Checkpoint
Types of Checkpoints Note:  XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page.  Checks the data content of  XML documents  XML Checkpoint  Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines.  Identifies areas of a Web site  to check for Section 508 compliancy  Accessibility Checkpoint  Check that the value in a database query is correct.  Checks the contents of databases accessed by an application or Web site  Database Checkpoint
Descriptive Programming Samples Descriptive programming Entering Programmatic Descriptions Directly into Statements Browser("Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "Mark Twain "  Using Description Objects for Programmatic Descriptions   Set MyDescription = Description.Create() MyDescription("text").Value = "OK" MyDescription("width").Value = 50 Window("Error").WinButton(MyDescription).Click
Adv. Synchronization Points Using tool menu options Wait property Programmatically Wait & exist
Exception Handling Recovery Scenario Concepts Recovery Process  Trigger Events Recovery Operation Post-recovery Operation
Sample Script – QTP Functions 'sample 1 - Getting all the items from the combobox My_Cnt = Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount msgbox My_Cnt For i = 1 to My_Cnt ' the combobox item index will start from zero. My_item = Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i-1) Msgbox My_item Next 'sample 2 - Getting the entire content of the combobox Var_Content = Window("Flight Reservation").WinComboBox("Fly From:").GetContent Msgbox Var_Content
Sample Script – QTP Functions 'sample 3 - Selecting an item from the combo -  Using Index Window("Flight Reservation").WinComboBox("Fly From:").Select(5) 'sample 4 - Selecting an item from the combo -  Using Value Window("Flight Reservation").WinComboBox("Fly From:").Select("London") 'sample 5 - Selecting an item from the combo -  Using Variable Var_Item = "Zurich" Window("Flight Reservation").WinComboBox("Fly From:").Select(Var_Item) 'sample 6 - Getting the value of selected item Var_Sel = Window("Flight Reservation").WinComboBox("Fly From:").GetSelection Msgbox Var_Sel
Sample Script – QTP Functions ' Some FUM's (Frequently Used Methods)  'GetROProperty Var_Text = Window("Flight Reservation").WinEdit("Name:").GetROProperty("AttachedText") Msgbox Var_Text Var_Enab = Window("Flight Reservation").WinEdit("Name:").GetROProperty("Enabled") Msgbox Var_Enab 'Exist If Window("Flight Reservation").WinEdit("Name:").Exist(5) Then Msgbox "The Editbox exists" Else Msgbox "The Editbox does not exist" End if
Thank You

More Related Content

PPT
QTP with Descriptive programming
PPT
Qtp 8.0 basic
DOC
Qtp interview questions and answers
DOC
What are the features in qtp
PPT
Qtp 9.5 Tutorials by www.onsoftwaretest.com
PPTX
Test Case Management with MTM 2013
PPT
Ppt Qtp
QTP with Descriptive programming
Qtp 8.0 basic
Qtp interview questions and answers
What are the features in qtp
Qtp 9.5 Tutorials by www.onsoftwaretest.com
Test Case Management with MTM 2013
Ppt Qtp

What's hot (14)

PPT
Test Director Ppt Training
PPT
MTM Test Management System
PPT
Automation Framework/QTP Framework
PDF
MTLM Visual Studio 2010 ALM workshop - day1
PPT
Qtp training
PPTX
Web service testing using QTP (UFT)
PPT
Tao scripting demo
PPTX
Keyword-driven Test Automation Framework
PDF
SAP TAO 2.0
DOC
Qtp questions and answers
PPT
Copy of qtp presentation
PPTX
QTP Power Point Presentation
PDF
SAP Testing Training
PDF
Combined Project
Test Director Ppt Training
MTM Test Management System
Automation Framework/QTP Framework
MTLM Visual Studio 2010 ALM workshop - day1
Qtp training
Web service testing using QTP (UFT)
Tao scripting demo
Keyword-driven Test Automation Framework
SAP TAO 2.0
Qtp questions and answers
Copy of qtp presentation
QTP Power Point Presentation
SAP Testing Training
Combined Project
Ad

Viewers also liked (6)

PPT
QTP VB Script Trainings
PPT
PPT
400 Kv Soja
PPTX
Contoh Presentasi Powerpoint Untuk Sidang Skripsi
PDF
Contoh Presentasi Proposal Skripsi
PPTX
Basic vbscript for qtp
QTP VB Script Trainings
400 Kv Soja
Contoh Presentasi Powerpoint Untuk Sidang Skripsi
Contoh Presentasi Proposal Skripsi
Basic vbscript for qtp
Ad

Similar to Qtp 9.2 tutorials (20)

PPT
Qtp Training Deepti 1 Of 4187
PPT
Qtp Basics
PPT
Qtp 80 Basics3561
DOC
Qtp interview questions and answers
PPT
QTP Training by INFOTECH
PPS
About Qtp_1 92
PPS
About QTP 9.2
PPS
About Qtp 92
PPT
Why Automate
PPT
Alm qc 11_training
PPT
HP Quick Test Professional
PPT
Hp Quick Test Professional
PDF
Getting started with_testcomplete
PPT
Qtp 9.2 examples
PPTX
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
PPT
Test Automation
PPT
Test Automation for QTP
PPTX
The Importance of Performance Testing Theory and Practice - QueBIT Consulting...
PPT
First QTP Tutorial
PPT
QTP Tutorial Slides Presentation.
Qtp Training Deepti 1 Of 4187
Qtp Basics
Qtp 80 Basics3561
Qtp interview questions and answers
QTP Training by INFOTECH
About Qtp_1 92
About QTP 9.2
About Qtp 92
Why Automate
Alm qc 11_training
HP Quick Test Professional
Hp Quick Test Professional
Getting started with_testcomplete
Qtp 9.2 examples
OS-Final-Transform-Manual-Testing-Processes-to-incorporate-Automatio....pptx
Test Automation
Test Automation for QTP
The Importance of Performance Testing Theory and Practice - QueBIT Consulting...
First QTP Tutorial
QTP Tutorial Slides Presentation.

More from medsherb (9)

PDF
Unknown facts about sanitary pads
PPT
Severity & priority in software testing
PPT
Basic software-testing-concepts
PPT
Qtp with descriptive programming
PPT
Using correlation in loadrunner 80
PPT
Load runner 8.0
PPT
Loadrunner presentation
PPT
Testcase training
PPT
Unit testing
Unknown facts about sanitary pads
Severity & priority in software testing
Basic software-testing-concepts
Qtp with descriptive programming
Using correlation in loadrunner 80
Load runner 8.0
Loadrunner presentation
Testcase training
Unit testing

Recently uploaded (20)

PDF
Basic Mud Logging Guide for educational purpose
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
PDF
Open folder Downloads.pdf yes yes ges yes
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Pre independence Education in Inndia.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Insiders guide to clinical Medicine.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
master seminar digital applications in india
Basic Mud Logging Guide for educational purpose
Open Quiz Monsoon Mind Game Prelims.pptx
Open folder Downloads.pdf yes yes ges yes
O7-L3 Supply Chain Operations - ICLT Program
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
human mycosis Human fungal infections are called human mycosis..pptx
TR - Agricultural Crops Production NC III.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
GDM (1) (1).pptx small presentation for students
102 student loan defaulters named and shamed – Is someone you know on the list?
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial disease of the cardiovascular and lymphatic systems
Pre independence Education in Inndia.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Insiders guide to clinical Medicine.pdf
Anesthesia in Laparoscopic Surgery in India
master seminar digital applications in india

Qtp 9.2 tutorials

  • 1. Automation Fundamental Concepts and Intro. about QTP 9.2
  • 2. Automation Fundamental Concepts What is Test Automation ? Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time… When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation… Automation helps to avoid human errors and also expedite the testing process… To implement the Test Automation detailed planning and effort is required
  • 3. Automation Fundamental Concepts Automation saves time and effort which results in reduction of the Test life cycle… Benefits of Automation - Consistency of Test Execution - Reducing cycle time of regression test cycles - Data driven testing - Repeatability - Coverage - Reliability - Reusability of test wares
  • 4. Automation Fundamental Concepts Automation life cycle is a subset of the entire test life cycle… Automation planning can be initiated in parallel to the test planning phase… Factors to be considered in automation planning, Stability of AUT (Application under test) No of regression cycles to be performed Compatibility of App platform with testing tools Cost benefit analysis (ROI) Availability of skilled resources
  • 5. Regression Testing & Automation When Automation is applicable? Regression Testing Cycles are long and iterative. If the application is planned to have multiple releases / builds If it’s a long running application where in small enhancements / Bug Fixes keeps happening Test Repeatability is required
  • 6. Technologies Supported Default Support 1. Standard Windows applications 2. Web objects / Applications 3. ActiveX controls 4. Visual Basic applications Supported Add-ins QuickTest Professional Java Add-in 9.1 QuickTest Professional .NET Add-in 9.2 QuickTest Professional Oracle Add-in 8.2 QuickTest Professional PeopleSoft Add-in 8.2* QuickTest Professional Add-in 8.2 for SAP Solutions QuickTest Professional Siebel Add-in 8.0* QuickTest Professional Stingray Add-in 8.2 QuickTest Professional Terminal Emulator Add-in 8.0* QuickTest Professional VisualAge Smalltalk Add-in 8.2 QuickTest Professional Web Services Add-in 9.2
  • 7. Supported Browsers Microsoft Internet Explorer 6.0 Service Pack 1 Microsoft Internet Explorer 7.0 Netscape Browser 8.1.2 Mozilla Firefox 1.5 Mozilla Firefox 2.0
  • 8. Add-in Manager Default Add-ins ActiveX Visual basic Web Other Add-Ins Siebel Java SAP Oracle .Net and many more
  • 9. Add-in Manager Cont… QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test) Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager. It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro.
  • 10. Mercury QuickTest Professional Introduction to QTP QuickTest Professional, the Mercury advanced keyword-driven testing solution enables you to test standard Windows applications, Web objects, ActiveX controls, and Visual Basic applications. You can also acquire additional QuickTest add-ins for a number of special environments (such as Java, Oracle, SAP Solutions, .NET Windows and Web Forms, Siebel, PeopleSoft, Web services, and terminal emulator applications).
  • 11. QuickTest Window The QuickTest window contains the following key elements: QuickTest title bar —Displays the name of the currently open test or component. Menu bar —Displays menus of QuickTest commands. File toolbar —Contains buttons to assist you in managing your test or component. Testing toolbar —Contains buttons to assist you in the testing process. Debug toolbar —Contains buttons to assist you in debugging your test or component (not displayed by default). Action toolbar —Contains buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Test pane —Contains the Keyword View and Expert View tabs. Active Screen —Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
  • 12. Continued… Data Table —Assists you in parameterizing your test or component. For a test, the Data Table contains the Global tab and a tab for each action. For a component, the Data Table contains single tab. Debug Viewer pane —Assists you in debugging your test or component. The Debug Viewer pane contains the Watch Expressions , Variables , and Command tabs (not displayed by default). Status bar —Displays the status of the QuickTest application.
  • 14. 1. Prepare to Record Objectives Review documented user steps of a business transaction. Understand the application under test and its environment. Prepare the test environment to utilize QuickTest Professional correctly.
  • 15. Quick Test Professional - Record & Run Modes Recording Modes Normal Analog Low level Run Modes Normal Fast Update
  • 16. Quick Test Professional -Tools  Options  General Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed.
  • 17. QuickTest Professional Options->General A best practice when setting general options for QuickTest are to: Deselect all check boxes except “Save data for integrating with performance testing …” and “Display Add-in Manager on startup”. Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed.
  • 18. Quick Test Professional - Tools  Options  Run
  • 19. Quick Test Professional - Options  Run Best Practices for Options for Run Mode: Run Mode as Normal: This ensures that the execution arrow appears to help with trouble shooting the tests. Synchronization becomes better for the AUT (Application Under Test) Test Results: Deselect the option “View Results when run session ends” Mercury Tool Integration: Select "Allow other Mercury products to run tests and components“ Screen Capture: Save step screen capture to results "On error and warnings"
  • 20. Automation  Record and Run Settings
  • 21. Record and Run Settings Best Practices for Record & Run Settings Set the options to configure QTP to "Record and run test on any open Windows- based application“ Set the option - This window will appear the first time you click on the Record button in the new test. Manually recall this window by selecting Automation  Record and Run settings
  • 22. QTP - Main Window
  • 23. QTP - Main Window Test Pane: Test Pane contains two labs to view the tests, - Keyword View - Expert View Keyword View: Quick Test Pro displays your test in the form of a collapsible, icon based tree… Expert View: Quick Test Pro displays the source code (VB Script) of the tests in this view.
  • 24. 2. Create a Test Objectives Create a basic test from a manual test case. Run a test and check for errors. Store the test file. Discuss the importance of initial and end conditions.
  • 25. The User Interface The QuickTest Professional user interface is broken up into a number of functional areas. You can choose to focus on one or more areas depending on the task you are performing.
  • 26. Record a Test Once the record button is pressed and test steps are performed , QuickTest listens and records the activities. This results in the recording and storing of each step of the business process. Each step consists of: The object The method (operation) The method property (a value for the action performed on the object) QuickTest should be running before the application under test is invoked. For some environments, this is mandatory.
  • 27. Saving a Test Saving the test in Quality Center Only relevant when using QTP with QC A bulls-eye symbol in the header with “Open Test from Quality Center” appears A folder structure is listed under the parent directory “Subject” You have the option to click the File System button on the upper right corner Once you have logged into Quality Center: Select your folder Type in the test name Save the file Save a test in QuickTest Professional If you are using QuickTest Professional alone the file system you will save to is under the QuickTest Professional’s test directory. You have the option to save the test results along with the test.
  • 28. Steps to Run a Test From the QTP Toolbar, click on the Run Button. A best practice is to use the temporary folder to hold the results while debugging your test. Press the OK button to execute the Run command.
  • 29. Viewing the Test Run When you run a test, QuickTest performs each step as it was recorded. You can watch in the AUT as QuickTest performs each step. A yellow arrow in the left margin of the KEYWORD VIEW points out the step currently running. When QuickTest finishes running the test, you can open the Test Results window.
  • 30. Steps to View the Results Decide if results must be viewed. If yes, select TEST->RESULTS from the QTP menu bar. View the outcome of the test run. Expand the results tree. From the Test Results menu bar, select VIEW->EXPAND ALL
  • 31. View Test Results Failure “roll-up” to the parent at the top level of the tree. Expand the Test Results tree to see the outcome of each step. Navigate to the child step that caused the failure.
  • 32. 3. The Object Repository Objectives Define what a Quick Test Professional object is. Describe the role of the Object repository Identify a given object as part of a class. Describe how objects are recognized by Quick Test Professional. Use the Object Repository to find and add objects. Change object logical names using the Keyword View.
  • 33. Object Types A Quick Test Professional object is a graphic user element in an application, such as a button or a drop-down list. Objects are categorized into classes. Buttons, Graphic Images and Edit Boxes are a few examples of class types.
  • 34. QuickTest Object Properties In the example above, there are several objects called Buttons, two of which are: Update Order Delete Order. The only way to distinguish one object from the other of the same class is by the difference in object characteristics. Specific characteristics of an object within QuickTest are called object properties.
  • 35. QuickTest Recognizes Objects QuickTest uses a method when it learns objects during the recording process. QuickTest first looks at the object you are recording and stores it as a test object, determining its object class. For example, QuickTest might classify the test object as a standard Windows dialog box or a web button. For each object class, QTP has a default set of properties that it always learns. Usually, only a few properties are needed to uniquely identify an object.
  • 36. Assigning a Logical Name After learning the class and properties of an object, QTP assigns a name to the object. This is known as the object’s logical name. QTP refers to the object in a recorded test by using its logical name. Edit the logical name to make it more descriptive if you wish. The logical name given to an object during recording may be sufficient, but changing a logical name can give clarity to the test and the documentation that is generated.
  • 37. Stored Test Objects Recorded object properties are stored in QTP’s Object Repository. Each test has its own Object Repository, by default.. These “stored” objects are referred to as “ Test Objects”. The purpose of a Test Object is to represent application objects in the test. During a test run, QTP uses the Test Object to search for a match in the application during run time.
  • 38. Steps to change A Logical Name You can change an object’s logical name in the OBJECT REPOSITORY. Right-click on the object at the KEYWORD VIEW level. Choose OBJECT PROPERTIES. Click on the REPOSITORY button.
  • 39. The Object Properties Dialog Once in the Object repository: Right-click the object in the repository tree. Choose RENAME. Type a descriptive name for the object. Click OK.
  • 40. QuickTest Documentation QuickTest updates the object name and documents it in the documentation field of the Keyword View. IMPORTANT: if you start a brand new test, the test will record the original, default object names in the Object Repository.
  • 41. 4. Synchronization Objectives Define Synchronization. Examine when and where synchronization is most helpful. Add a synchronization step for a specified object.
  • 42. What is Synchronization ? Synchronization is a step added to a test that instructs QuickTest to wait for the state of a property on a particular object to change before proceeding to the next step in the test. This is done while in RECORD mode. The user/test waits for a visual indication that a step has completed so that the user/test can take the next step.
  • 43. Some Visual Cue Examples A progress bar reaches 100% completion. A status message appears. A button becomes enabled. A window opens and is ready for data entry. A pop-up message appears in response to an operation.
  • 44. Examine the Application Quick Test defaults to allocating the same amount of time for every object. Wait times often occur before an object becomes available for the next step. For example, in the Flights application, once the Insert Order button has been clicked, a process bar must complete to yield the Order No. associated with the reservation. The process bar may require additional time before the test can proceed. If insufficient time is allocated for these special circumstances, the test may fail. The error message “Object not enabled” appears if QuickTest is running a test and proceeds to the next step before the previous step has fully processed.
  • 45. Add a Synchronization Step While Recording Synchronization points which instruct QuickTest to pause until an object property achieves a specific value.The easiest method is to add a synchronization point while recording. A Synchronization step can be added manually after a test is recorded , as well. Always add the synchronization point immediately after the step to be synchronized. From the QTP menu bar, choose INSERT  STEP  SYNCHRONIZATION POINT
  • 46. Resources  Object Repository Can add a New Object to the repository More properties for recognizing the object can be added to the list. The value of property can be edited here.
  • 47. Resources  Object Repository Manager
  • 48. Resources  Associate Repositories Add shared Repository
  • 49. Resources  Object Repository Associate repository is added to the Filter option.
  • 50. Object Repository  Merging tool Secondary Repository Primary Repository .
  • 51. Object Repository  Comparison Tool Comparing two repositories'
  • 52. Synchronization Synchronization point enables the anticipated time problems between the application and QTP. A progress bar reaches 100% completion. A status message appears. A button becomes enabled. A window opens and is ready for data entry. A pop-up message appears in response to an operation.
  • 53. How to synchronize the Test We can synchronize the test by 1.Inserting a synchronization point Insert  Step  Synchronization point Window(“Flights”).WinButton(“Update order”).WaitProperty”enabled”,1,1000 2.Adding Exist and Wait statements status=Window(“Flights”).Dialog(“Flights Table”).Exist Wait(10)
  • 54. Checkpoints A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. We can Insert checkpoint 1.From Menu Insert  Checkpoint  Standard Checkpoint 2.From Keyword view 3.From the Active Screen
  • 55. Checkpoint Types 1.Standard Checkpoint 2.Image Checkpoint 3.Table Checkpoint 4.Page Checkpoint 5.Text Checkpoint 6.Text Area Checkpoint 7.Bitmap Checkpoint 8.Database Checkpoint
  • 56. Insert A Checkpoint From The Active Screen A checkpoint can be added after a test is created. Use the Active Screen to select the field on which the checkpoint will be added. Right-click on the appropriate field and choose “Insert Standard Checkpoint”.
  • 57. Regular Expressions Regular expressions enable Quick Test to Identify Objects and text strings with varying values.
  • 58. Use a Regular Expression A regular expression is a string that specifies a complex search phrase. By using special characters you define the conditions of the search. Note: There are 4 steps to ensure that a regular expression is inserted correctly. From the Checkpoint Properties window, ensure Constant is enabled and click on the note paper icon. Check Regular Expression checkbox. If QTP sees there are characters that can be misconstrued as a regular expression, it will ask you to treat it as a literal character. Generally, you will answer No. Add the regular expression. For example, Figure 6-6 will use [A-Z a-z]+.
  • 59. Parameters Objectives Describe and use multiple parameter types. Drive data in multiple iterations. Analyze errors during iterations. Parameterize a checkpoint.
  • 60. Input Parameters For Data driven Tests Input Parameters For Data Driven Tests A data-driven test is one that runs a set of user actions with multiple input values. Data driving allows one script to test application functionality with many sets of data. Automated data driven testing frees you to perform more tests, thus increasing test coverage. Speed, repeatability, free resources to do other kinds of quality control.
  • 61. Input Parameter Input Parameters allow you to replace a static, recorded value in a step with a dynamic placeholder (parameter), which represents an expandable range of values. Input parameter names and their values are located in QuickTest’s Data Table. Input parameter values are input into the application from some outside data source.
  • 62. Steps to Create An Input Parameter To create an input data table parameter: Select the step in the Keyword View that contains the recorded input value. From the Value column, click on the current value. Click on the parameterize button. The Constant value appears in the Value Configuration Options dialog box.
  • 63. Set the Parameter Value In the VALUE CONFIGURATION OPTIONS dialog, select the Parameter radio button and ensure that Data Table is selected from the drop-down list. From the Name drop down list, enter a unique column name to create a new column in your data table or choose an existing column name from the data table. Use the default Global data sheet to store values. Enter the values that QTP will input after the test executes.
  • 64. Supply Data to the Parameter The design-time table is the central location for storing input parameter values. The number of rows in the data table will cause the same number of test execution iterations to be run. As a default, the design-time data table is displayed at the bottom of the QuickTest screen. If you want to show or hide the data sheet, click on the icon in the toolbar.
  • 65. Verify The Test Run View the Test Results window to verify that each of the rows from the Design Time Data Table was used during the test run. Expand the tree for each iteration (Row#) to view specific information about the execution of the specific row.
  • 66. Parameterize a Checkpoint You can use parameterized expected values to make your checkpoints dynamic. They Can be set on: An object property in the Object Repository. A checkpoint on a parameterized field.
  • 67. A Test with Multiple Actions Actions can be divided into logical sections, like the main sections of a transaction, or by specific business processes. When you create a new test, it contains one action. By dividing your tests into multiple actions, you can design more modular and efficient tests.
  • 68. Types of Actions There are two kinds of actions: Regular (Non-reusable) Reusable Tests that contain reusable actions can be used: Locally Externally
  • 69. Insert Call to a New Action You can add a new action during or after recording. Select Insert ? New Action from the QuickTest main menu. The Insert New Action window appears. Or use the “lego” icon on the toolbar to insert new action.
  • 70. Using Parameterized Data Test data can be passed from one test to another test using the value of an input parameter. This creates a data flow between business processes. The value passed from one business process to another will come from the Data Table. Be aware of any data dependencies that occur within the business process.
  • 71. Copied, Existing or New Action After reusable actions are created, they can be called into a “Main Calling” test in three ways: Call to New Action Call to Copy of Action Call to Existing Action
  • 72. Set Actions as Reusable Create a reusable action from the Action properties dialog. Check the checkbox and click OK. A message will appear stating a description of a reusable action.
  • 73. Call An Action You can do number of things with a reusable action, such as: Call it multiple times within a test. Call it from other tests. View the components of the action tree (you cannot modify them except in the original script) Insert a call to an external action (the action is inserted in read-only format) as local editable copy use the (read only) data from the original action Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions.
  • 74. One Action used Many Times Rather than recording the login process three times in three separate tests, and enhancing this part of the script (with checkpoints and parameterization) separately for each test, you can create an action that logs into the application in one test. Best Practice Inserting calls to existing actions makes it easier to maintain our tests; when an object or procedure in your application changes. It only needs to be updated one time, in the original action.
  • 75. Set Actions as Reusable Create a reusable action from the Action properties dialog. Check the checkbox and click OK. A message will appear stating a description of a reusable action.
  • 76. On Action – Two Names Use the Action Properties – General tab to modify the default label. This makes the test easier for others to understand when viewing the test from the Keyword View tree. Right-Click on Action and enter a logical name for the business process.
  • 77. Call An Action You can do number of things with a reusable action, such as: Call it multiple times within a test. Call it from other tests. View the components of the action tree (you cannot modify them except in the original script). Insert a call to an external action (the action is inserted in read-only format) - as local editable copy - use the (read only) data from the original action Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions.
  • 78. External Action Properties An external action is a reusable action created in another test. The external action is inserted into the calling test in a read-only format. Data from the external action’s data sheet can be imported as a local, editable copy or kept as read only. If read-only, the data can only be modified from the original test. After a reusable action is called, you will see the parameters contained in each test appear in the Global or Local sheet depending on where you stored them in the original test.
  • 79. Action Run Settings Since there are two (or more) tests running, one right after another, you may need to specify the iteration for each separately. To affect the run settings for a particular action, set them in the Action Call Properties dialog box. Right-Click on the Action label in the Keyword View, and choose Action Call Properties from the list provided.
  • 80. Defining an Action The Action Properties dialog box enables you to define options for the stored action. You can modify an action name, add or modify an action description, and set an action as reusable.
  • 81. Passing Values to a Called Action You can also define input and output parameters to be used by the action. These settings apply each time the action is called.
  • 82. Using an Action Parameter Once parameters have been set in Action Properties, you can tell QuickTest that the parameter type being used is an Action Parameter.
  • 83. The Test Flow List The Test Flow List: - Changes with the addition of a reusable action. - Enables viewing of the action tree for a selected reusable or external action. The test flow appears when a test is recognized as having called actions in your test. An action tree displays all the details of the selected reusable or external action.
  • 84. Action Data Structure In the Action data structure, each Action will have its own: Folder with an object repository Local data table sheet Run settings
  • 85. Multiple Reusable Actions When using multiple, reusable actions, keep the following in mind: Actions can be called or copied from another test. Run settings have to be set per action As a default, all actions in a test use the same shared Object Repository. Parameters and data from the called test are reflected in the calling test An action can be deleted or an action call can be deleted. Position your action calls separately or nest them with other actions.
  • 86. Delete an Action Because reusable actions can be used throughout your test or test set, when you delete an action, you must decide to delete a specific occurrence of the action and/or all of its calls. A different message appear when you are about to delete a non-reusable action.
  • 87. Data Table Sheets - Global The Global Data Sheet: Enables you to create a new column or select an existing column in the Global sheet of the Data Table. Inserts or outputs a value from or to current row of the global data sheet during each global iteration at run-time. Provides a source of values that can be seen and used by any action.
  • 88. Data Table Sheets - Local When a Local Data Sheet is used: The parameters and data will appear with different tabs in the main calling test’s Data Table. It allows you to iterate reusable actions independently of any other called actions. You will need to link parameters in the “main calling test”
  • 89. Recovery Scenarios To instruct Quick test to recover from unexpected events and errors that occur in the testing environment during the run session. A Recovery scenario consists of a) Trigger Event b) Recovery Operation c) Post Recovery Run Option
  • 90. Recovery Scenario Wizard We can create the recovery scenario using recovery scenario wizard. Recovery scenario wizard consists of a) Define the trigger event that interrupts the run session b) Specifying the recovery operations required to continue c) Choosing a post recovery test run operation d) Specifying a name and description for the recovery scenario e) Specifying whether to associate the recovery scenario to the current test and / or to all new tests.
  • 92. Creating Tests without Object Repository We can use programmatic descriptions to perform an operation on an object that is not stored in the Object Repository. Types of Programmatic descriptions a) We can list the set of properties and values that describe the object directly in a test statement. e.g: Dialog(“name:=Login”).WinEdit(“attachedtext:=agentname”).Set”impetus” b) We can add a collection of properties and values to a description object and then enter the description object in the statement. Set myobject=Description.Create() myobject(“attachedtext”).value:=“agentname” myobject(“html tag”).value:=“a” Dialog(“name:=Login”).WinEdit (myobject).Set”impetus”
  • 93. Interact with Test Objects not stored in the Object Repository You can also instruct QT to perform methods on objects without referring to the object repository without referring to the object’s logical name. To do this you provide QT with a list of properties and values that QT can use to identify the object or objects on which you want to perform a method Enhance TestCases With Descriptive Programming
  • 94. You can describe an object directly in a test statement by specifying property : = value pairs describing the object instead of specifying an object’s logical name. Syntax:- TestObject(“PropertyName1:=PropertyValue”, “…”, “PropertyNameX:=PropertyValueX”) Where “Test Object” is test object class Enter Programmatic Descriptions Directly into Test Statements
  • 95. PropertyName is PropertyValue i.e. the test object property and its value . Each property:= value pair should be separated by commas and quotation marks. For Example: Window(“Text:=Myfile.txt-Notepad”).Move 50,50 If you want to use the same programmatic description several times in one test, you may want to assign the object you create to a variable. For Ex:- Set MyWin := Window(“Text:=Myfile.txt-Notepad”) MyWin.Move 50,50 Contd….
  • 96. Once we have filled the Properties collection with a set of Property objects (properties and values), you Can specify the Properties object in place of a logical name in a test statement. For Ex:- (Instead of Entering) Window(“Error”).WInbutton(“text:=OK”, “width:=50”).click IF Entered… Set MyDescription= Description.Create() MyDescription(“text”).Value=“OK” MyDescription(“width”).Value=50 Window(“Error”).WinButton(MyDescription).Click Contd….
  • 97. VB Script basics – Data Types
  • 98. VB Script basics – Variables & Constants Declaring Variables Naming Restrictions Scope and Lifetime of Variables Assigning Values to Variables Scalar Variables and Array Variables Creating Constants
  • 99. VB Script basics - Operators
  • 100. VB Script basics – Conditions & Looping Conditional Statements If...Then...Else statement Select Case statement Looping Do...Loop: Loops while or until a condition is true. While...Wend: Loops while a condition is true. For...Next: Uses a counter to run statements a specified number of times. For each...Next: Repeats a group of statements for each item in a collection or each element of an array.
  • 101. VB Script basics – Functions
  • 102. Key areas in QTP About the script structure Actions (Simple, Nested, External, Re-usable) Parameterization (Different Types) Checkpoints (Programmatic Methodology) Descriptive programming Adv. Synchronization points Exception Handling
  • 103. About the script structure
  • 104. Actions (Simple, Nested, External, Re-usable) Standalone Actions Nested Actions Integration of Actions (Call from One Action to other) Driver Action (Main Action) Re-usable Actions External Call for Actions
  • 105. Parameterization Classifications of Parameterization Test and Action Parameters Data Table (Global & Action Specific) Environment variables Random Number
  • 106. Types of Checkpoints Check that a Web page (or any portion of it) is displayed as expected. Checks an area of a Web page or application after capturing it as a bitmap Bitmap Checkpoint Check whether the expected text string is displayed in the expected location on a Web page or dialog box Checks that a text string is displayed in the appropriate place in a Web page or application window Text / Text Area Checkpoint Check how long a Web page takes to load or if a Web page contains broken links. Checks the characteristics of a Web page Page checkpoint Check that the value in a table cell is correct. Checks information in a table Table Checkpoint Check that the image source file is correct. Checks the property values of an image Image Checkpoint Check that a radio button is selected. Checks values of an object’s properties Standard Checkpoint
  • 107. Types of Checkpoints Note: XML file checkpoints are used to check a specified XML file; XML application checkpoints are used to check an XML document within a Web page. Checks the data content of XML documents XML Checkpoint Check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines. Identifies areas of a Web site to check for Section 508 compliancy Accessibility Checkpoint Check that the value in a database query is correct. Checks the contents of databases accessed by an application or Web site Database Checkpoint
  • 108. Descriptive Programming Samples Descriptive programming Entering Programmatic Descriptions Directly into Statements Browser("Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "Mark Twain " Using Description Objects for Programmatic Descriptions Set MyDescription = Description.Create() MyDescription("text").Value = "OK" MyDescription("width").Value = 50 Window("Error").WinButton(MyDescription).Click
  • 109. Adv. Synchronization Points Using tool menu options Wait property Programmatically Wait & exist
  • 110. Exception Handling Recovery Scenario Concepts Recovery Process Trigger Events Recovery Operation Post-recovery Operation
  • 111. Sample Script – QTP Functions 'sample 1 - Getting all the items from the combobox My_Cnt = Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount msgbox My_Cnt For i = 1 to My_Cnt ' the combobox item index will start from zero. My_item = Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i-1) Msgbox My_item Next 'sample 2 - Getting the entire content of the combobox Var_Content = Window("Flight Reservation").WinComboBox("Fly From:").GetContent Msgbox Var_Content
  • 112. Sample Script – QTP Functions 'sample 3 - Selecting an item from the combo - Using Index Window("Flight Reservation").WinComboBox("Fly From:").Select(5) 'sample 4 - Selecting an item from the combo - Using Value Window("Flight Reservation").WinComboBox("Fly From:").Select("London") 'sample 5 - Selecting an item from the combo - Using Variable Var_Item = "Zurich" Window("Flight Reservation").WinComboBox("Fly From:").Select(Var_Item) 'sample 6 - Getting the value of selected item Var_Sel = Window("Flight Reservation").WinComboBox("Fly From:").GetSelection Msgbox Var_Sel
  • 113. Sample Script – QTP Functions ' Some FUM's (Frequently Used Methods) 'GetROProperty Var_Text = Window("Flight Reservation").WinEdit("Name:").GetROProperty("AttachedText") Msgbox Var_Text Var_Enab = Window("Flight Reservation").WinEdit("Name:").GetROProperty("Enabled") Msgbox Var_Enab 'Exist If Window("Flight Reservation").WinEdit("Name:").Exist(5) Then Msgbox "The Editbox exists" Else Msgbox "The Editbox does not exist" End if