This action might not be possible to undo. Are you sure you want to continue?
An Advance Guide Valuable Resource for Certification Exam HPO-M39
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
♠ Object Repository Type and Object Recognition ♠ Shared Object Repository ♠ Checkpoints ♠ Transactions and Step Generators ♠ Exception Handling and Recovery Scenarios ♠ Analysis of Test Results
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
Object Repository Type and Object Recognition
What is an Object Repository ?
Object Repository is a collection of objects pertaining to the application under test. Example: All the text boxes, list boxes, images etc are stored in a file in QTP. This file is called the object repository. Each object will have the set of properties to identify that object uniquely in the application. At the time of execution, QTP identifies the objects on the screen by comparing them with the objects and their properties in the repository.
We can have any number of Shared Object Repositories associated with an action. In QTP 10.0 all the objects are recorded into the local repository and then we need to export the objects from local repository into the shared object repository by opening the object repository and selecting File Menu and selecting "Export Local Objects". We need to specify the name for the shared object repository in which we want to save these objects.
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
Object Repository Type and Object Recognition ♥ Object Identification ♥ Recording Modes: Context sensitive Mode Low-level Mode Analog Recording Mode ♥ Virtual Objects >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
softwaretestinggenius.com <<<<<<<<<<<< .Object Repository Type and Object Recognition ♠ Types of Object Repository ♦ Per – action object repository ♦ Shared object repository ♠ Per – action object repository ♦ ♦ ♦ ♦ Default repository Specific to actions (Will be used only for a particular action) Preferable when application is not dynamic with respect to time Cannot be reused >>>>>>>>>>>> www.
com <<<<<<<<<<<< .Object Repository Type and Object Recognition ♠ Per – action object repository ♦ Default repository ♦ Specific to actions (Will be used only for a particular action) ♦ Preferable when application is not dynamic with respect to time ♦ Cannot be reused Example Action1 and Action 2 of same test will have different object repositories.softwaretestinggenius. >>>>>>>>>>>> www.
Object Repository Type and Object Recognition ♠ Shared Object Repository ♦ Can be updated by all actions accessing it ♦ Preferable when application is dynamic with respect to time ♦ Used in most automation projects ♦ Needs maintenance and administration >>>>>>>>>>>> www.com <<<<<<<<<<<< .softwaretestinggenius.
com <<<<<<<<<<<< .Object Repository Type and Object Recognition Shared object repository may be common to all tests and to all actions inside each test Shared object repository Test1 Test2 Test3 Action1 Action2 Action3 Action1 Action2 Action3 Action1 Action2 Action3 >>>>>>>>>>>> www.softwaretestinggenius.
Object Repository Type and Object Recognition What is Object Identification? Object identification is a method of instructing QTP to recognize the various objects in the application. but for some applications this may not be true.com <<<<<<<<<<<< . for recognizing the objects uniquely.softwaretestinggenius. >>>>>>>>>>>> www. In this scenario we need to tweak the Object Identification settings of QTP to learn extra properties or custom properties defined in the application. Usually QTP can identify the objects uniquely for most of the applications/objects.
and select the environment (windows.Object Repository Type and Object Recognition How to do Object Identification in QTP? Go to . QTP will show you the mandatory and assistive properties which are grabbed and used currently for that object. >>>>>>>>>>>> www. web etc). check boxes etc.Tools . You can select the extra properties which are already defined in the application for that kind of object by clicking on the green "+" sign and selecting the required properties.softwaretestinggenius.com <<<<<<<<<<<< . This will give you all the possible type of objects in that environment like Edit boxes.Object identification . If you still have the problem of recognition then you need to find out the unique property defined for that object type from the development team and Add that custom property by clicking "New" in the Add/Remove properties window of Object identification. Select the type of object you have problem recognizing uniquely.
If you want to update the existing objects run the test in the Update Run mode and select the checkbox Update Object Properties. you can click "New" and give the new property name as "attribute/RefGen".softwaretestinggenius. >>>>>>>>>>>> www. These are QTP setting changes not the script changes. Note: The changes you make in the Object Identification will affect everyone working on that machine.com <<<<<<<<<<<< . For example if the custom property name is "RefGen". These changes should be applied universally on all the machines you intend to run the regression tests. When you record next time on that kind of object the new properties will be automatically grabbed.Object Repository Type and Object Recognition How to do Object Identification in QTP? If you still have the problem of recognition then you need to find out the unique property defined for that object type from the development team and Add that custom property by clicking "New" in the Add/Remove properties window of Object identification.
softwaretestinggenius. >>>>>>>>>>>> www.objects of same class object.Object Repository Type and Object Recognition Object Identification User can specify properties to be used for identification to distinguish between 2 .com <<<<<<<<<<<< .
Object Repository Type and Object Recognition Configuring Mandatory and Assistive Recording Properties: ♥ Mandatory properties: >>>>>>>>>>>> www.com <<<<<<<<<<<< .softwaretestinggenius.
It uses assistive properties when mandatory properties are not enough to identify an object. which it always learns.com <<<<<<<<<<<< .softwaretestinggenius. >>>>>>>>>>>> www. for each type of object.Object Repository Type and Object Recognition Mandatory properties: ♥ QTP has list of mandatory properties. ♥ When we run the script QTP uses all the mandatory properties to identify the object.
com <<<<<<<<<<<< .Object Repository Type and Object Recognition ♥ We can change the mandatory properties or assistive properties based on the application.softwaretestinggenius. ♥ We can add /remove few properties in mandatory properties or assistive properties so that QTP identifies the object when we run the script >>>>>>>>>>>> www.
Object Repository Type and Object Recognition ♠ How to change properties of objects? ♥ Tools Object Identification ♥ Object Identification dialog box opens ♥ Select the properties you want to make mandatory or assistive by selecting the option • Options are available to the user • Selected properties will be made mandatory in this case • Selection of properties should be based on nature of application • Same is applicable to assistive properties >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
com <<<<<<<<<<<< .Object Repository Type and Object Recognition Recording Example… Mandatory Properties: Html tag: Text: Inner Text: A Testing Testing During recording QTP has stored both the mandatory as well as assistive properties for identifying the particular link.softwaretestinggenius. Let us check why? Recording a link… Assistive Properties: Coordinate X: Coordinate Y: URL: Color: Font: Green Arial 256 298 >>>>>>>>>>>> www.
com <<<<<<<<<<<< .Object Repository Type and Object Recognition Mandatory Properties: Html tag: Text: Inner Text: A Testing Testing During Recording Now QTP is able to identify the link with captured 3 Mandatory properties and 5 Assistive properties!! Starts using assistive properties and checks object Includes 1st Property n d Assistive Properties: Coordinate X: 234 Includes 2 Property Coordinate Y: 286 URL: www.com Includes 3rd Property Color: Font: Orange Arial 5th 4th QTP uses Assistive properties if the stored Mandatory properties are not enough to identify an object >>>>>>>>>>>> www.abcd.softwaretestinggenius.
Object Repository Type and Object Recognition Selecting an Ordinal Identifier: ♥ In addition to mandatory properties and assistive properties. During a Record Session If mandatory properties and assistive properties are insufficient to identify an object during record session QTP uses Ordinal Identifier in addition to other captured properties to identify the objects during a record session >>>>>>>>>>>> www.softwaretestinggenius. QTP records backup ordinal identifier for each test object ♥ Used when QTP is not able to identify an object with captured mandatory properties and assistive properties during recording. Ordinal identifier is used if mandatory properties and assistive properties captured by QTP is insufficient to identify an object in the application during record session. In other words.com <<<<<<<<<<<< .
Object Repository Type and Object Recognition Types of Ordinal identifiers: ♥ Index based ♥ Location based ♥ Creation Time Index: Indicates the order in which the object appears in the application code relative to other objects. pressing a tab and giving numbers to objects Location: Indicates the order in which the object appears within the parent window.com <<<<<<<<<<<< . or dialog box relative to other objects with an otherwise identical description CreationTime (Browser object only): Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description..softwaretestinggenius. >>>>>>>>>>>> www. An ordinal identifier is selected by default for each test object class. select the desired type from the Ordinal identifier box. frame. Eg. To modify the selected ordinal identifier.
>>>>>>>>>>>> www. This Creation Time is not available in the ordinal identifier options of other environments. Location and Creation time.Object Repository Type and Object Recognition Setting up which ordinal identifier to use during object identification: ♥ User can select which ordinal identifier to be used by selecting the options in object identification ♥ The ordinal identifier in web will have three options namely Index.softwaretestinggenius. The first occurrence is 0.com <<<<<<<<<<<< . Options for Web Options for other Environments Identifying an Object Using the Index Property: QuickTest can assign a value to the Index test object property of an object The value is based on the order in which the object appears within the source code.
in relation to other objects with the same properties. ♥ The value is based on the order in which the object appears within the window.softwaretestinggenius.Object Repository Type and Object Recognition Identifying an Object Using the Location Property: ♥ During recording.com <<<<<<<<<<<< . QuickTest can assign a value to the Location test object property of an object in order to uniquely identify the object. Example: Numbered based on location property >>>>>>>>>>>> www. and left to right. frame. or dialog box. First occurrence value = 0 ♥ Values are assigned in columns from top to bottom.
it examines the order in which the browsers were opened. QuickTest is unable to uniquely identify a browser object based solely on its test object description.Object Repository Type and Object Recognition Identifying an Object Using the CreationTime Property : ♥ During recording. it assigns a value to the CreationTime test object property. ♥ This value indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description. Opening a new browser with an application Opening a new browser with same application QTP notes the creation time of both browsers as creation time property Example >>>>>>>>>>>> www.com <<<<<<<<<<<< . if QuickTest is unable to identify a browser object based solely on its test object description.softwaretestinggenius. ♥ During the run session. and then uses the CreationTime property to identify the correct one.
♥ Smart identification uses two types of properties and are base filter properties and optional filter properties >>>>>>>>>>>> www. If its not able to identify the object with the description.softwaretestinggenius.Object Repository Type and Object Recognition Configuring Smart Identification: ♥ Configuring Smart Identification properties enables you to help QuickTest identify objects in your application. About Configuring Smart Identification: ♥ QTP uses object description for identifying an object. even if some of the properties in the object's recorded description have changed.com <<<<<<<<<<<< . then it goes for smart identification mechanism.
com <<<<<<<<<<<< . Eg. but can be ignored if they are not applicable.Object Repository Type and Object Recognition Base Filter Properties: ♥ Most fundamental properties of object class or values which cannot be changed without changing the essence of the original object.softwaretestinggenius. Optional Properties: ♥ Other properties to identify objects for a particular class as they are unlikely to change on regular basis. you could no longer call it the same object. if a Web link's tag was changed from <A> to any other value. >>>>>>>>>>>> www..
♥ Click the Configure button next to the Enable Smart Identification check box. The Configure button is enabled only when the Enable Smart Identification option is selected. ♥ The Smart Identification Properties dialog box opens: >>>>>>>>>>>> www.com <<<<<<<<<<<< .Object Repository Type and Object Recognition Step-by-step Instructions for Configuring a Smart Identification Definition: ♥ Tools > Object Identification.softwaretestinggenius. ♥ Select the test object class you want to configure. ♥ Select the appropriate environment in the Environment list. The test object classes associated with the selected environment are displayed in the Test object classes list. The Object Identification dialog box opens.
Click OK to close the Add / Remove Properties dialog box. The Add/Remove Properties dialog box for optional filter properties opens. The updated set of base filte properties is displayed in the Base Filter Properties list. click Add/Remove.Object Repository Type and Object Recognition Base filters & Optional filters: ♥ In the Base Filter Properties list. . Same applies for optional properties also. In the Optional Filter Properties list. ♥ Select the properties you want to include in the Base Filter Properties list and/or clear the properties you want to remove from the list. click Add/Remove. Use the up and >>>>>>>>>>>> down arrows to set your preferred order for the optional <<<<<<<<<<<< www.softwaretestinggenius. ♥ The Add/Remove Properties dialog box for base filter properties opens.com filter properties.
Low-level and Analog Recording Context sensitive: ♥ This is the Default mode of recording which takes full advantage of QuickTest's test object model. ♥ Recognizes objects in application regardless of their location on the screen. Eg.Object Repository Type and Object Recognition Recording Modes – Context sensitive. ♥ QTP’s Analog recording is captured as Tracks and stored in the directory of your test ♥ Useful for recording operations that cannot be recorded at the level of an object. A signature produced by dragging the mouse in a paint will be recorded in analog recording MS Paint If recorded using Context sensitive mode. You will not get any drawing during playback MS Paint If recorded using Analog mode..softwaretestinggenius. ♥ Records the objects in your application and the operations performed on them. Analog Recording: ♥ Records the exact mouse and keyboard operations you perform in relation to either the screen or the application window.com <<<<<<<<<<<< . You will be replay it back successfully >>>>>>>>>>>> www.
♥ Used when recording tests in an environment (or on an object) not recognized by QuickTest.softwaretestinggenius.com <<<<<<<<<<<< . ♥ Records at the object level and records all run-time objects as Window or WinObject test objects. whether or not QuickTest recognizes the specific object or the specific operation.Object Repository Type and Object Recognition Recording Modes – Context sensitive. >>>>>>>>>>>> www. ♥ Used when the exact coordinates of the object are important for your tests. Low-level and Analog Recording Low Level Recording: ♥ Enables you to record on any object in your application.
softwaretestinggenius. user can avoid scenarios which may stop automation of a test scenario. We will not be able to proceed on with recording the remaining part of the script without the line. Scenario: ♥ During recording.VirtualObject(“A").. E.Object Repository Type and Object Recognition Virtual Objects: ♥ Substitutes for standard objects ♥ Used when standard objects cannot be recorded due to problems that arise during recording ♥ Virtual objects cover the regions in the application that QTP has failed to identify. Try creating a cell in excel sheet as Virtual Object and try recording it and check the script The following example clicks the "button" VirtualButton.Click >>>>>>>>>>>> www.ActiveX(“Z"). Syntax: Browser(“X").g. ♥ By creating virtual objects. That particular part of application will be covered and marked as virtual object in the script.. ♥ Create virtual objects and start recording.com <<<<<<<<<<<< .Page(“Y"). QTP can fail to identify certain objects in the application screen.
Check box & Radio button.com <<<<<<<<<<<< .Object Repository Type and Object Recognition Defining a Virtual Object: ♥ Click Tools > Virtual Object > New Virtual Object ♥ You will get the steps as mentioned below Click Next Class can be Object. Mark radio button from the drop down shown if QTP has failed to identify a radio button in the application during recording a script Next page for next step >>>>>>>>>>>> www.softwaretestinggenius. Button. Table. List.. Mark a class based on the object which is present in his application Eg.
Object Repository Type and Object Recognition Step3 Step4 Click Mark Object button (The QTP screen is minimized) You will get a cross hairs pointer Use the cross hairs pointer to mark the object in application You can select entire parent hierarchy or parent only Step6 Step5 Add virtual object to a collection >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
softwaretestinggenius.Shared Object Repository >>>>>>>>>>>> www.com <<<<<<<<<<<< .
softwaretestinggenius.Shared Object Repository Shared object repository Test1 Action1 Action2 Action3 Action1 Test2 Action2 Action3 Action1 Test3 Action2 Action3 >>>>>>>>>>>> www.com <<<<<<<<<<<< .
Reusability of objects Changes in object properties can be updated directly in the shared object repository model >>>>>>>>>>>> www.Shared Object Repository Same object repository for related functionalities across different actions or scripts It is also possible to add new objects to the existing repository either manually or while recording We can also specify additional properties for objects other than mandatory ones that appear when the objects are captured.com <<<<<<<<<<<< .softwaretestinggenius.
Shared Object Repository Implementing Shared Object Repository: The object repository can be managed using a folder containing all the object repositories which have been used throughout the project.time Same object repository for related functionalities across different actions or scripts >>>>>>>>>>>> www.com <<<<<<<<<<<< .softwaretestinggenius.tsr files) are stored module wise. Files under this which contain object repositories (which are stored as . Inserting Shared Object Repositories: There are two ways of adding shared object repositories to a test script 1) At design time 2) At run .
Now all the actions in this particular script can use the objects present in the added shared object repository. Enter the path of the shared object repository in the text box given in the Object repository type frame. Click on Apply button and then click on the OK button. >>>>>>>>>>>> www. Click on the Shared radio button under Object repository type frame. Select the “Resources” tab in the Test Settings window.softwaretestinggenius. Go to Test Settings in the menu bar.Shared Object Repository Steps to add a shared object repository : Open the Quick Test script.com <<<<<<<<<<<< .
Application") newApp.softwaretestinggenius.Settings.Shared Object Repository VB Script for creating shared object repository at run-time Option Explicit On error resume next Dim newApp Dim newObjRepository Dim strObj_Path 'As newApplication declare the Application object variable 'As newObjectRepository 'Declare a Repository Object Variable ' To Set the Shared Object Repository Path ' Open QuickTest and prepare objects variables Set newApp = CreateObject("QuickTest.Launch newApp.ObjectRepositoryPath = strObj_Path >>>>>>>>>>>> www.Resources strObj_Path = <path of the object repository> newObjRepository.com <<<<<<<<<<<< .Test.Visible = True 'Create the Application object ‘Start QuickTest 'Make the QuickTest application visible Set newObjRepository = newApp.
softwaretestinggenius. 6. In the Confirmation window that appears. 7. Go to Test Settings in the menu bar. >>>>>>>>>>>> www. Select the “Resources” tab in the Test Settings window. We release this memory space at the end of each action to enhance the performance of the script.Shared Object Repository Releasing Objects When we add object repositories to a test script during run – time. Click on the No button to use “. Click on the Shared radio button under Object repository type frame. Set newApp = Nothing ‘Release the Application object Set newObjRepository = Nothing 'Release the object repository object Regular Expressions Regular Expression is similar to the usage of wild card characters in search functionalities. 5. 8. 2. Go to Tools Object repository in a Quick Test script. a particular memory space is allocated to each of the object. Open the Quick Test script. Click on the button highlighted in the snapshot given in next page 4.com <<<<<<<<<<<< . The extract given below is included at the end of each action to release the objects. Select the Object property of the object that needs to be regularised. Click on OK button in the Constant Value Options.*” as a regular expression and not as characters. Steps to use regular expression: 1. 3.
%.Shared Object Repository There are other types of regular expressions that can be used apart from “.*”. Shared object repository needs Object Repository Manager for managing all the object repositories. etc. >>>>>>>>>>>> www. The basic function of an ORM is to take back up of the object repositories from time to time to prevent object repositories from becoming corrupt.softwaretestinggenius. such as \ .com <<<<<<<<<<<< .
softwaretestinggenius.Check Points >>>>>>>>>>>> www.com <<<<<<<<<<<< .
Check Points What is a Checkpoint? A confirmation or verification point in which the value of some property which is expected at a particular step is compared with the actual value which is displayed in the application is called a Checkpoint. >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
a dynamic value displayed in application from database.softwaretestinggenius. Check points are Classified as under: Standard Checkpoint Page Checkpoint Text / Text Area Checkpoint Image Checkpoint Database Checkpoint XML Checkpoint Bitmap Checkpoint Table Checkpoint Accessibility Checkpoint >>>>>>>>>>>> www.Check Points The expected value can be property of an image or web page or a table with values displayed in application. portion of text or text displayed in a specified region.com <<<<<<<<<<<< . bitmap of image displayed or dynamic text displayed from XML.
drop downs. images and links. User can select few values in the table or select all the values as expected value. User also has options to parameterize the values. >>>>>>>>>>>> www.Check Points Standard Checkpoint: Standard Checkpoint checks for property value of object displayed in any application. A user who records a standard check point can select the properties of any property he wishes to check. combo boxes. button. The value column is stored as expected result and can be modified or parameterised when creating and modifying checkpoint. Object can be radio button. QTP will check only the fields specified by the user.softwaretestinggenius. Expected result If the value in the application is displayed as a table then this check point is called as Table Checkpoint.com <<<<<<<<<<<< .
softwaretestinggenius. A user who uses this check point can give approximate amount of time that will be required for the page to load so that QTP will fail this checkpoint when page takes more time to load than specified. number of images or links in a web page.com <<<<<<<<<<<< . Load time: The time taken by a web page to load. checking every links and images. Number of links and images present in a web page Consider this a web page Process Assets Process DB Reports Prospective Business Module Project Budgeting System Project Setup Proposal Information System Order Login Print Close QTP Results: No of Links: 6 No of Images: 4 >>>>>>>>>>>> www. Page Checkpoint includes checking Load time.Check Points Page Checkpoint: A Standard Checkpoint created for a web page can be called a Page Checkpoint. HTML Source and Tags verification and checking for broken lines.
Check Points Checking links and images: User can check all the links and images present in his application with the links and images expected with a page checkpoint.com <<<<<<<<<<<< . Checkpoint results will show the expected and actual result obtained as shown below. HTML Source of a web page and broken lines in a web page can also be checked using a page check point >>>>>>>>>>>> www.softwaretestinggenius.
softwaretestinggenius. Options will be provided to the user to export the contents to excel sheet in the same format >>>>>>>>>>>> www. space mismatches and for exact matches.Check Points Text/Text Area Checkpoint: Checks the text present in a web page or any application. Text Checkpoint can check for case sensitivity. QTP verifies whether the expected text with the actual text appearing and shows output as shown below. A text mismatch will be shown as represented above. We can store the expected text that should be present in the application when creating this checkpoint. These three options can be configured by the user as shown Expected result is shown in green color and actual content that captured in the web application is shown in red color.com <<<<<<<<<<<< .
softwaretestinggenius.Check Points Database Checkpoint: Compares the dynamic values displayed in the application with the values from the database. Application Software Testing India Query written in QTP to check random values: Select * from data where company = ‘Software Testing’. Total number of Client : 10 Total number of employees: 2500 Total number in onsite: 200 Number in offshore : 3200 Values retrieved from database by QTP Cl_num 10 emp_num 2500 on_num 200 off_num 3200 Dynamic values from database >>>>>>>>>>>> www.com <<<<<<<<<<<< . User will write a SQL query when creating this checkpoint with which QTP will check the dynamic values displayed in application.
Check Points Database Checkpoint: Compares the dynamic values displayed in the application with the values from the database. Application Software Testing India Query written in QTP to check random values: Select * from data where company = ‘Software Testing Genius’. User will write a SQL query when creating this checkpoint with which QTP will check the dynamic values displayed in application.softwaretestinggenius. Total number of Client : 10 Total number of employees: 2500 Total number in onsite: 200 Number in offshore : 3200 7000 700 Values retrieved from database by QTP Cl_num 10 emp_num 2500 on_num 200 off_num 3200 Dynamic values from database >>>>>>>>>>>> www.com <<<<<<<<<<<< .
softwaretestinggenius. QTP helps in comparing the values in the XML with the values displayed in application and also can validate the schema of XML. The contents displayed in a web application from XML is checked Expected input values can be parameterized XML Schema can also be validated with the checkpoint >>>>>>>>>>>> www. there will be several places for which data from XML will be displayed .com <<<<<<<<<<<< .Check Points XML Checkpoint: In web application.
softwaretestinggenius.com <<<<<<<<<<<< . QTP will check whether the expected bitmap which is recorded previously exists in the application and provide us with appropriate results.Check Points Bitmap Checkpoint: A Bitmap checkpoint helps a user in checking bitmap of an image or a full web page. Mismatch! Bitmap Checkpoint Failed >>>>>>>>>>>> www. Usually users should create record this checkpoint in prototype and will use the application for running.
When you insert Accessibility checkpoint using QTP for all pages in your application.com <<<<<<<<<<<< . Consumer can set his preferences for this checkpoint. it checks whether every page of the application follows the guidelines of W3C. These guidelines should be strictly followed for all web application. We can instruct QTP for doing automatic accessibility checkpoint for every page we browse with the options provided.Check Points Accessibility Checkpoint: This checkpoint is specific to Web applications.softwaretestinggenius. World Wide Web Consortium (W3C) came up with some instructions and guidelines for Web-based technology and information systems. >>>>>>>>>>>> www.
Transactions and Step Generators >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
Transactions and Step Generators Transactions: Process in your application that you are interested in measuring.softwaretestinggenius.com <<<<<<<<<<<< . >>>>>>>>>>>> www. Include transactions to the section of your script to measure the time that is taken by your application to run those specified steps. Can be inserted anywhere in the script No limits to number of transactions you can create You can create a transaction within a transaction.
Decide where you want the transaction timing to begin: To insert a transaction before the current step. or choose Insert > Start Transaction.StartTransaction “Test_Transaction” Click the Start Transaction button opens.com <<<<<<<<<<<< Click OK. . Syntax: Services. To insert a transaction after the current step. A Start Transaction step is added to the Keyword View. select After current step.Transactions and Step Generators Inserting Transactions A transaction is inserted by a method called startTransaction. Note: You cannot include spaces in a transaction name. The Start Transaction dialog box Enter a meaningful name in the Name box. >>>>>>>>>>>> www.softwaretestinggenius. select Before current step.
Decide where to insert the end of the transaction: To insert a transaction before the current step. Click OK. The End Transaction dialog box opens as shown below The Name box contains a list of the transaction names you defined in the current test. Select the name of the transaction you want to end. An End Transaction step is added to the Keyword View.com <<<<<<<<<<<< .softwaretestinggenius. select After current step. >>>>>>>>>>>> www.Transactions and Step Generators Ending Transactions : A Transaction is ended using the method End Transaction.EndTransaction "Test_Transaction” To end a transaction: Click the End Transaction button or choose Insert > End Transaction. select Before current step. To insert a transaction after the current step. Syntax Services.
SetTransactionStatus Status >>>>>>>>>>>> www.Transactions and Step Generators AddWastedTime Method Description This method specifies the wasted time (in milliseconds) for all open transactions.AddWastedTime (WastedTime) SetTransactionStatus Method Description Sets the status for all open transactions present Syntax Services.softwaretestinggenius.com <<<<<<<<<<<< . Syntax Services.
Transactions and Step Generators Step Generator: Enables you to add steps quickly and easily. by selecting from a range of context-sensitive options and entering the required values. and internal script functions To open the Step Generator from the Keyword View or Expert View : While recording or editing. In the Step Generator dialog box you can define steps that use: Test object methods and properties Utility object methods and properties Calls to library functions. VBScript functions.com <<<<<<<<<<<< The Step Generator dialog box opens and displays the object from the selected step in the Object box.softwaretestinggenius. >>>>>>>>>>>> www. press F7. Choose Insert > Step > Step Generator or right-click the step and choose Insert Step > Step Generator. . click the step which you want the new step to follow. Alternatively.
>>>>>>>>>>>> www. click the step which you want the new step to follow. If the location you clicked is associated with more than one object.com <<<<<<<<<<<< .Transactions and Step Generators To open the Step Generator from the Active Screen while editing: 1. The Step Generator dialog box opens and displays the object from the selected step in the Object box. QuickTest will insert it after this step. 3. (When you finish defining the new step. Select an object and click OK. right-click the object for which you want to insert a step. 2. Confirm that the Active Screen is displayed. 4. and choose Step Generator.softwaretestinggenius. In the Keyword View or Expert View. 5. the Object Selection Step Generator dialog box opens. choose View > Active Screen or toggle the Active Screen toolbar button. If it is not.) The Active Screen displays the captured bitmap or HTML source corresponding to the selected step. In the Active Screen.
com <<<<<<<<<<<< . you first select the type of step that you want to add to your test or component. Selecting the Type of Step to Add In the Category list box. WaitProperty.Transactions and Step Generators Defining a New Step: When you define a new step. SetTOProperty. You can then select the specific object and method for the step. Functions: Enables you to select a function for the step from one or all the available libraries. etc. you can choose one of the following options: Test Objects: Enables you to select a test object and method for the step.softwaretestinggenius. can be done using this Step Generator function. or the function that you want the step to use. >>>>>>>>>>>> www. Utility Objects: Enables you to select a utility object and method for the step. Numerous other operations such as GetROProperty.
Exception Handling and Recovery Scenarios >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
softwaretestinggenius. Debugging : ♠ In QTP there is a window called Debugging window which contains three tabs ♠ Watch Expressions ♠ Variables ♠ Command Watch Expressions: ♠ If the user is concerned about one or more specific variable value or values of some vbscript expression. then the user can enter those variable names in the first column of the watch expression tab. ♠ When the test case is run in a step-by-step mode using breakpoints. >>>>>>>>>>>> www. despite a run-time error.com <<<<<<<<<<<< . we can see the current value of the variables/ vbscript expression entered in the first column of the watch expression tab. if it is previously enabled using On Error Resume Next. On Error Go to 0 : This statement is used to disable error handling.Exception Handling and Recovery Scenarios On Error Resume Next : This statement causes execution to continue.
>>>>>>>>>>>> www. Entire initialized variable names and its current value are displayed. user can insert breakpoint and the execution will suspend when it reaches any break point.com <<<<<<<<<<<< . the same will get reflected in the Variables tab.Exception Handling and Recovery Scenarios Variables: ♠ User can check all the initialized variables and their values during the program execution in the Variables tab. ♠ During program execution if the value of any variable changes. ♣ During execution. Hence the user can easily analyze the code with this. Commands: ♣ This tab helps in modifying the values of the variables at run time (while executing the script in step-by-step format).softwaretestinggenius.
♠ At this point the user can enter the variable name and assign the new value to check whether the code works fine. if new value is assigned at this moment.Exception Handling and Recovery Scenarios ♠ Let us assume the variable strVarName = “very good”. >>>>>>>>>>>> www.com <<<<<<<<<<<< . ♠ After entering the new value. ♠ For eg. if the user starts running the script from that step. ♠ By changing the variable value during the execution time. the new value will be considered as the current value of the variable. the user enters strVarName = “Hi this is the new value” in the Command tab.softwaretestinggenius. user can make sure if the variable attains the mentioned value.
Exception Handling and Recovery Scenarios
Automation of QTP:
♠ Let us discuss two scenarios where automation of QTP is preferred. ♠ When more users are involved in an automation project then scripts generated by these users may not be of same standards and hence when integration of scripts gives problems. ♠ When automated scripts are moved to client, in client location, we may need to do configuration of QTP and associate other files/paths such as library files, folder paths, recovery scenario files, environment files etc... ♠ In both these cases lot of effort is required and the person who is doing such configuration must be very sure of what he is doing, otherwise proper execution of the script won’t happen. ♠ We can easily create such programs by utilizing the “Generate Script” functionality provided in QTP. ♠ This “Generate Script” functionality is provided in three places ♠ From these three sections, we can create 3 VBScript files, which can be combined together to create a final VBScript file, if required which can perform all the above mentioned functionalities.
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
Exception Handling and Recovery Scenarios
Generate Script – Object Identification:
♠ In this section we can set the Mandatory properties, Assistive properties, Smart Identification configuration etc for all kinds of objects for all the loaded add-ins.
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
Exception Handling and Recovery Scenarios
Generate Script – Test Settings :
♠ Through the highlighted button, we can generate the script which will set the associated add-ins with this test case, ♠ Run options (Run on all rows, Run one iteration only... for global sheet) Library files, Parameters, Recovery scenario files, ♠ Load environment variable files, Browser navigation timeout settings, Username and Password settings for accessing the application through the Active screen. ♠ The easiest way to create the custom file is by setting the proper configuration once, and generate the script with the help of this button.
>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<
com <<<<<<<<<<<< .Exception Handling and Recovery Scenarios Generate Script – Tools/Options : ♠ In the above mentioned section we can create the script to control the general settings which are applicable for all the test cases. never. capturing of screen shots during (error. on errors and warnings).softwaretestinggenius. >>>>>>>>>>>> www. enable/disable the integration of QTP with other mercury tools. ♠ We can set the folder paths. amount of information that should be captured through Active screen. execution mode (Fast/Normal). and advance web settings. always.
Link("link_name") >>>>>>>>>>>> www. QuickTest will bypass this step and continue to run the test.softwaretestinggenius.Exception Handling and Recovery Scenarios Optional Steps : ♠ When running a test or component. if a step in an optional dialog box does not open.Browser("browser_name"). right-click a step and choose Optional Step. but the step does not cause the test or component to fail.Page("page_name").com <<<<<<<<<<<< . ♠ When the run session ends. ♠ To set an optional step in the Keyword View. ♠ An optional step can be added in the Expert View by adding OptionalStep to the beginning of the VBScript statement. ♠ Example: OptionalStep. The Optional Step icon is added next to the selected step. a message is displayed for the step that failed to open the dialog box.
Recovery Operation(s): The operation(s) that need to be performed in order to continue running the test or component. if at all. For example. For example. Post-Recovery Test Run Option: The instructions on how QuickTest should proceed once the recovery operations have been performed. clicking an OK button in a pop-up window.com <<<<<<<<<<<< . a window that may pop up on screen. you may want to restart a test or component from the beginning.softwaretestinggenius.Exception Handling and Recovery Scenarios Recovery Scenarios : ♠ Unexpected events. >>>>>>>>>>>> www. errors. This problem may stop execution of tests. ♠ The Recovery Scenario Manager provides a wizard that guides you through the process of defining a recovery scenario ♠ A recovery scenario consists of the following: Trigger Event : The event that interrupts your run session. and application crashes during a run session can disrupt your run session and distort results. and from which point in the test or component QuickTest should continue. or a QuickTest run error. For example. or restarting Microsoft Windows. or skip a step entirely and continue with the next step in the test or component.
Exception Handling and Recovery Scenarios Steps for creation Step 6: Define a recovery operation and click on next button >>>>>>>>>>>> www.com <<<<<<<<<<<< .softwaretestinggenius.
com <<<<<<<<<<<< .softwaretestinggenius.Exception Handling and Recovery Scenarios Steps for creation Step 12: Click finish if you like to quit or proceed with available options >>>>>>>>>>>> www.
softwaretestinggenius. Since there is limited time for the Recovery Scenario to kick off. i. Recovery scenarios do not get executed when QTP is in a Wait loop. if we have a wait statement after a particular step (say for about 15 sec) then the Recovery Scenario will not get executed for the entire wait period and in the meantime it is quite possible that the AUT has moved from the screen that was expected resulting in a failure of the Recovery Scenario Take care when using recovery scenarios >>>>>>>>>>>> www.Exception Handling and Recovery Scenarios Care must be taken when you are adding more than one recovery scenario in a script.com <<<<<<<<<<<< . the most frequently used recovery scenario should be at the top of the list and the list should later be refined as the interaction with the AUT increases.e.
com <<<<<<<<<<<< .Analysis of Test Results >>>>>>>>>>>> www.softwaretestinggenius.
softwaretestinggenius.Analysis of Test Results >>>>>>>>>>>> www.com <<<<<<<<<<<< .
open the excel sheet. then it may be difficult for the users to understand the result of such execution. displaying the execution results in a more readable format is called formatting of Result reporting.Analysis of Test Results What is formatting of Results and when is it used? ♥ After the test execution completes. ♥ Library functions written can be used to create text file to log all the result which in turn will act as log files for the execution of test cases. However. but this comes as mandatory if the client is having only QTP and not Test Director. These reports can be generated from Test Director.com <<<<<<<<<<<< .. ♥ When the test cases are executed through these automation tools.softwaretestinggenius.. >>>>>>>>>>>> www. enter the result in the specified row and column in the specified format (Bold.). How is it used? ♥ We can write VBScript library functions which can get the information from calling action/function.. excel sheet or Html format will give very clear picture about the result than a text file. italic.
individual excel file can be analysed.softwaretestinggenius. it will create a new folder with current system date and time and ♣ Create a new excel file and create one excel sheet for each test case i.e.com <<<<<<<<<<<< .Analysis of Test Results Various types ♥ We can write functions such that whenever a test case is run. To find the individual execution results. >>>>>>>>>>>> www. ♣ Create one excel file/ sheet for each test case ♣ Create one excel file per test case and N no of sheets for N no of iterations of same test case ♣ Create one Batch folder which will create one excel file/sheet and report the details of all the test cases that was executed in the batch – to give the consolidated information about the execution of the batch. create one excel file and N no of excel sheets for N no of test cases.
across actions. >>>>>>>>>>>> www.com <<<<<<<<<<<< .softwaretestinggenius. ♥ There are two types of environment variables: • Built-in • User-defined Build-in Variables: ♥ As the name suggests. Built-in environment variables are those environment variables that are predefined User Defined: ♥ User defined environment variables are ones in which the user gives the value and name of the environment variable and this value holds good throughout the script.Analysis of Test Results Environment Variables ♥ Variables that can be set to a particular value and the value can be used throughout the script.
Thank You >>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<< .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.