UNIFIED FUNCTIONAL TESTER 1152020 UFT 1 Overview on

  • Slides: 105
Download presentation
UNIFIED FUNCTIONAL TESTER 11/5/2020 UFT 1

UNIFIED FUNCTIONAL TESTER 11/5/2020 UFT 1

Overview on Test Automation 11/5/2020 MANUAL TESTING 2

Overview on Test Automation 11/5/2020 MANUAL TESTING 2

Overview on Test Automation Manual Testing Automation Testing 1. Time consuming and tedious: Since

Overview on Test Automation Manual Testing Automation Testing 1. Time consuming and tedious: Since test cases are executed 1. Fast Automation runs test cases significantly faster than human by human resources so it is very slow and tedious. resources. 2. Huge investment in human resources: As test cases need to 2. Less investment in human resources: Test cases are executed by using be executed manually so more testers are required in manual automation tool so less tester are required in automation testing. 3. Less reliable: Manual testing is less reliable as tests may not 3. More reliable: Automation tests perform precisely same operation be performed with precision each time because of human each time they are run. errors. 4. Non-programmable: No programming can be done to write 4. Programmable: Testers can program sophisticated tests to bring out sophisticated tests which fetch hidden information. 11/5/2020 MANUAL TESTING 3

Overview of UFT 11/5/2020 MANUAL TESTING 4

Overview of UFT 11/5/2020 MANUAL TESTING 4

UFT Product Information 1. It is a functional and regression testing tool. 2. UFT

UFT Product Information 1. It is a functional and regression testing tool. 2. UFT is developed using. NET technology. 3. It is an object based test tool , but no front end object reference required. 4. Windows Based: Window, Dialog box, Button, Edit Box, Check Box etc. 5. Web Based: Browser, Page, image, Link etc. 11/5/2020 MANUAL TESTING 5

UFT Version History 1. Astra Quick. Test Version 1. 0 to 5. 0 2.

UFT Version History 1. Astra Quick. Test Version 1. 0 to 5. 0 2. QTP 5. 6 – 2002 3. QTP 6. 5 – 2003 4. QTP 8. 0 – 2004 5. QTP 8. 2 – 2005 6. QTP 9. 0 – 2006 7. QTP 9. 2 – 2007 -----MERCURY INTERACTIVE---------8. QTP 9. 5 – 2008 -----HP------9. QTP 10. 0 – 2009 10. QTP 11. 0 – 2010 11. UFT 11. 5 - 2012 11/5/2020 MANUAL TESTING 6

UFT License 1. Seat License: This license is tied to the computer on which

UFT License 1. Seat License: This license is tied to the computer on which it is installed. The trial or a demo license of UFT is a seat license which has a validity of 30 days. You don’t require any keys for the trial license. 2. Concurrent License: This is also known as floating license. This license type requires a concurrent license server to be installed in your office/local network. With concurrent license, a pool of licenses are assigned to the concurrent license server. Anybody in a local network can connect to this pool as long as at least a single license is available. 2 a) Commuter License: This can be said as a special type of concurrent license which can be used when you don’t have access to the license server. In this case, you checkout a license from the concurrent license server for ‘n’ days where n <= 180. 2 b) Remote Commuter License: This is used when you want a license for a particular machine but that machine is not able to connect to the license server for checkout purposes. In that case, you would take help of a machine B which IS able to connect to the license server and checkout a license for John’s machine. A 11/5/2020 MANUAL TESTING 7

UFT Addin 1. Internal Add ins: a. Standard Windows b. Active. X c. Visual

UFT Addin 1. Internal Add ins: a. Standard Windows b. Active. X c. Visual Basic d. Web 2. External Add ins: a. Java b. . NET for Windows Forms c. . NET for Web Forms d. WPF e. SAP for Windows Forms f. SAP for Web Forms g. People Soft h. Delphi i. Power Builder j. Oracle k. SIEBEL L. Web Services etc. . 11/5/2020 MANUAL TESTING 8

Frameworks in UFT 11/5/2020 MANUAL TESTING 9

Frameworks in UFT 11/5/2020 MANUAL TESTING 9

Frameworks in UFT There are 3 types of Frameworks. 1. Data Driven Framework 2.

Frameworks in UFT There are 3 types of Frameworks. 1. Data Driven Framework 2. Keyword Driven Framework 3. Hybrid Framework 11/5/2020 MANUAL TESTING 10

Data Driven Framework The general steps involved in the data driven framework are: 1.

Data Driven Framework The general steps involved in the data driven framework are: 1. Prepare the Test Case for the Application Under Test 2. Add the Objects from AUT to Object Repository 3. Write the scripts based on the Test Case 11/5/2020 MANUAL TESTING 11

1. Prepare the Test Case for the Application Under Test The External source for

1. Prepare the Test Case for the Application Under Test The External source for this sample is an Excel file. The VB script in QTP must be written to open an Excel file in order to read the test data. This can be achieved in a hierarchical manner. 1. An excel file is first opened an as Application 2. Then the workbook must be opened from the specified location 3. The sheet where the test data are present. 4. Finally the cell must be read. 11/5/2020 MANUAL TESTING 12

2. Add the Objects from AUT to Object Repository Once the Test case is

2. Add the Objects from AUT to Object Repository Once the Test case is ready, start adding all the required objects to the repository. 1. Record your scenario and all the objects will be added in the object repository. 11/5/2020 MANUAL TESTING 13

Write the scripts based on the Test Case Before running the script, ensure that

Write the scripts based on the Test Case Before running the script, ensure that the excel file containing the test data has been saved and is closed. 11/5/2020 MANUAL TESTING 14

Advantages of Data Driven Framework • Large number of test data can be read

Advantages of Data Driven Framework • Large number of test data can be read and written in to the external file in a single test. • Loop statement is used to repeat the same steps for several iterations. Hence coding effort is reduced. • Since the data are read and written directly into the external file, there is no need to copy, paste or export data in order to use them. • Test Data can be read from any external file and the outputs can be written into any other external file. 11/5/2020 MANUAL TESTING 15

Disadvantages of Data Driven Framework • Scripting knowledge is required to develop this framework.

Disadvantages of Data Driven Framework • Scripting knowledge is required to develop this framework. • Sometimes more number or combinations of data from an external source like Database may slow down or even crash the QTP. 11/5/2020 MANUAL TESTING 16

Keyword Driven Framework • Keyword Driven Framework is a framework where keywords drive the

Keyword Driven Framework • Keyword Driven Framework is a framework where keywords drive the test. Here keyword refers to the user defined functions. 11/5/2020 MANUAL TESTING 17

Keyword Driven Framework 1. Record and run the test. 2. Add objects to the

Keyword Driven Framework 1. Record and run the test. 2. Add objects to the local repository and write the scripts for all test steps. 3. Write descriptive programming for all test steps. 11/5/2020 MANUAL TESTING 18

Keyword Driven Framework The functions that are created for different test cases are saved

Keyword Driven Framework The functions that are created for different test cases are saved in a function library and are associated with the main test. It is enough to call the keywords for the needed test cases in the main test thereby reducing the size of the driver script in the main test. The Driver Script for this simple framework looks as: 11/5/2020 MANUAL TESTING 19

Advantages of Keyword Driven Framework • Any number of test cases can be run

Advantages of Keyword Driven Framework • Any number of test cases can be run on a single test just by calling their respective keywords. • Writing general descriptive programming for all web/ windows objects & calling them as keywords will help in running the same test for different dynamic applications. • Reduces the size of the driver script. 11/5/2020 MANUAL TESTING 20

Disadvantages of Keyword Driven Framework • Time taken to develop these frameworks is very

Disadvantages of Keyword Driven Framework • Time taken to develop these frameworks is very high if there are very few number of test cases to run. • Recording the steps is not always used when designing KDF for many applications on a same test. 11/5/2020 MANUAL TESTING 21

Recording Modes in UFT 11/5/2020 MANUAL TESTING 22

Recording Modes in UFT 11/5/2020 MANUAL TESTING 22

Recording Modes in UFT Below are the types of recording modes 1. Normal Recording:

Recording Modes in UFT Below are the types of recording modes 1. Normal Recording: This is the default Recording mode that records the objects and the operations performed on the application under test. 2. Analog Recording: This records not only the keyboard actions but also the mouse movements relative to the screen or the application window. 3. Low-Level Recording: This records the exact co-ordinates of the objects independent of the fact whether UFT recognizes the object or NOT. It just records the co-ordinates, hence does NOT record mouse movements. 4. Insight Recording: UFT records operation based on its appearance and NOT based on its native properties. 11/5/2020 MANUAL TESTING 23

Normal/Default Recording Mode: Whenever user starts recording by default recording done in this recording

Normal/Default Recording Mode: Whenever user starts recording by default recording done in this recording mode. This recording mode is used to recognize standard objects of the AUT and save the object properties into the Object Repository (OR), it is also uses to record mouse movements & keyboard inputs. And this is how scripts recorded in normal mode are looks like: 11/5/2020 MANUAL TESTING 24

Low level Recording Mode: Low level recording is used to record mouse clicks, drag

Low level Recording Mode: Low level recording is used to record mouse clicks, drag & drop, and type operation on an object. But the recording is done on the bases of co-ordinates not its properties and i. e. why this recording mode is known as Low Level Recording mode, because in this mode QTP/UFT records the co-ordinate location of the object on which action has been performed. Following is the code of Low level recording mode: 11/5/2020 MANUAL TESTING 25

Analog Recording Mode: Whenever we need to record continues mouse movements, we can go

Analog Recording Mode: Whenever we need to record continues mouse movements, we can go with Analog Recording mode. The main funda behind this recording mode is it records your continues mouse movements in the form of a track and save this track file on your computer. 11/5/2020 MANUAL TESTING 26

Insight Recording Mode: There are cases when UFT is not able to recognize objects

Insight Recording Mode: There are cases when UFT is not able to recognize objects using their defined properties; the reason could be like developer has not assigned properties to object, or the properties assigned to object are not enough that UFT can recognize that object. In this situation we can take help of Insight Recording mode, which records object screenshots and perform actions on that. 11/5/2020 MANUAL TESTING 27

Object Repository 11/5/2020 MANUAL TESTING 28

Object Repository 11/5/2020 MANUAL TESTING 28

Object Spy and it Features Object Spy is a utility/option within QTP to add

Object Spy and it Features Object Spy is a utility/option within QTP to add objects to the Object Repository. 1. Upon Clicking on the Object Spy icon, the Object Spy Dialog box opens. The Objects can be added to the repository upon clicking the pointing hand. 2. After Spying the object, the object hierarchy will be shown. 3. After Spying an object, we can click on "Highlight" option to highlight the object in the application. 4. For adding the object into the Object Repository, one should click on "Add objects" button in the Object spy dialog. 5. The properties and its values are displayed for the selected object in the dialog box which should be Unique for QTP to recognize the objects while the script executes. 6. The supported operations on the object can be retrieved by clicking on the operation tab. Operations such as "click" for a button, "Set" for a text box are retrieved from the "operations" tab. 11/5/2020 MANUAL TESTING 29

Object Spy and it Features 11/5/2020 MANUAL TESTING 30

Object Spy and it Features 11/5/2020 MANUAL TESTING 30

Object Repositories • After Spying the object, adding the objects into Repository is the

Object Repositories • After Spying the object, adding the objects into Repository is the first step. The Script can execute successfully if and only if the objects are added into the Object Repository. Upon Clicking "Add Objects to OR", the objects are added into Object repository. 1. After adding objects to the OR, we can verify by navigating to "Resources" -> "Object Repository". The Object Repository Window opens and we can locate the added object in the Repository. 11/5/2020 MANUAL TESTING 31

Object Repositories 2. One can add the properties additionally apart from the default ones

Object Repositories 2. One can add the properties additionally apart from the default ones by clicking on "+" button and remove it using "x" button. If we want to restore to defaults we can click on the "circular arrow" button. 3. One can change the object's Name which will NOT have any effect on identifying the object uniquely. If there is a change in logical name, the same name should be used while scripting. Only the Object's Name can be changed and NOT its Properties 11/5/2020 MANUAL TESTING 32

Object Repositories 4. Properties of any object must be unique so that QTP will

Object Repositories 4. Properties of any object must be unique so that QTP will be able to recognize the objects and act on it. If the object properties are same for two or more objects then during execution an error would be thrown that "More than one object is matched for the specified properties". 5. After adding the objects, the same can be used in script by simple drag-drop. When the object is dragged and dropped, the default operation is set. Eg : Click for a button, Set for a Text Box etc. 11/5/2020 MANUAL TESTING 33

Types of Object Repositories Local Object Repository - As the Name Suggests, the Object

Types of Object Repositories Local Object Repository - As the Name Suggests, the Object Repository is applicable only for that Action. Shared Object Repository - The Object Repository is Shared across actions/modules which would be mapped for two or more actions. Local objects can be exported to be saved into Shared Object Repository by using the option "Export Local Objects" Options. 11/5/2020 MANUAL TESTING 34

Types of Object Repositories Local Object Repository(LOR) Shared Object Repository (SOR) This Object Repository

Types of Object Repositories Local Object Repository(LOR) Shared Object Repository (SOR) This Object Repository is available one for each action. This type of Object Repository is available for multiple tests and for multiple actions. This is the Object Repository that is available for each tests by default. This type of Object Repository is usually used in frameworks considering reusability and maintainability. Local Object Repository is Editable in Object Repository. Shared Object Respository is read only by default but can be edited in Object Repository Manager. It is NOT a standalone file that can edited. Shared Object Repository is a standalone file that can be edited easily. It is Saved with an Extension. bdb Shared Object Repository is saved with an extension . tsr It Should be used when not many tests are working on the same screens of the application under test. Shared Object Repository Should be used when there are different scripts interacting with the same type of the object. 11/5/2020 MANUAL TESTING 35

Ordinal Identifiers Sometimes there are series of objects with same class name and properties.

Ordinal Identifiers Sometimes there are series of objects with same class name and properties. Lets us say in a window there are series of checkboxes with the same set of properties. If we want to act on those objects we need to uniquely identify them so that QTP will be able to act on it. An Ordinal Identifier assigns a numerical value to the test objects which indicates its location or order relative to its group. The Ordered value enables QTP to recognize it uniquely when the inbuilt properties are NOT sufficient to do so. There are 3 Ordinal Identifiers in QTP that can be used in different context: 1. Index 2. Location 3. Creation Time 11/5/2020 MANUAL TESTING 36

Index An object appearing first in the page/Window will have a smaller Index value

Index An object appearing first in the page/Window will have a smaller Index value when compared to another object that comes later in the same page/Window. 11/5/2020 MANUAL TESTING 37

Location The Location property works vertically from top to bottom and from left to

Location The Location property works vertically from top to bottom and from left to right positions. 11/5/2020 MANUAL TESTING 38

Creation Time The Creation Time property holds good only for web based application. When

Creation Time The Creation Time property holds good only for web based application. When we open 2 browser sessions of the same website, QTP will not be able to recognize the window as both the window will have the same set of properties. Hence we can use creation time with which QTP will be able to act on the window. 11/5/2020 MANUAL TESTING 39

Actions 11/5/2020 MANUAL TESTING 40

Actions 11/5/2020 MANUAL TESTING 40

Actions 11/5/2020 MANUAL TESTING 41

Actions 11/5/2020 MANUAL TESTING 41

Types of Actions: There are three types of actions: Non-reusable action - An action

Types of Actions: There are three types of actions: Non-reusable action - An action that can be called only in that specific test in which it has been designed and can be called only once. Reusable action - An action that can be called multiple times any test in which it resides and can also be used by any other tests. External Reusable action - It is a reusable action stored in another test. External actions are read-only in the calling test, but it can be used locally with the editable copy of the Data Table information for the external action. 11/5/2020 MANUAL TESTING 42

Working with Actions 11/5/2020 MANUAL TESTING 43

Working with Actions 11/5/2020 MANUAL TESTING 43

Inserting call to New Action: Step: 1 - Right Click on the Scripting area

Inserting call to New Action: Step: 1 - Right Click on the Scripting area and select "Call to New Action“ 11/5/2020 MANUAL TESTING 44

Inserting call to New Action: Step: 2 - In the "Insert Call to New

Inserting call to New Action: Step: 2 - In the "Insert Call to New Action" Window, give the test name, description, and also specify if it is a reusable action or not. 11/5/2020 MANUAL TESTING 45

Inserting call to New Action: Step: 3 - User Can check the changes graphically

Inserting call to New Action: Step: 3 - User Can check the changes graphically in the test Name Tab. 11/5/2020 MANUAL TESTING 46

Inserting call to New Action: 'Input to the action num 1 = 5 num

Inserting call to New Action: 'Input to the action num 1 = 5 num 2 = 10 Dim value 1 'Run the action with parameters Output. Value = Run. Action("Calculate", one. Iteration, num 1, num 2, value 1) 'Display the output print Output. Value 11/5/2020 MANUAL TESTING 47

Inserting Call to Copy of Action: Step : 1 - Right Click on the

Inserting Call to Copy of Action: Step : 1 - Right Click on the Scripting area and select "Call to Copy of Action“. 11/5/2020 MANUAL TESTING 48

Inserting Call to Copy of Action: Step : 2 - In the "Insert Call

Inserting Call to Copy of Action: Step : 2 - In the "Insert Call to Copy of Action" Window, Select the "Test Name", "Action Name" and also select the location the action to be inserted. 11/5/2020 MANUAL TESTING 49

Inserting Call to Copy of Action: Step : 3 - Immediately script is auto

Inserting Call to Copy of Action: Step : 3 - Immediately script is auto generated to show that the copy of an action is inserted. Run. Action "Copy of Calculate", one. Iteration 11/5/2020 MANUAL TESTING 50

Inserting Call to Copy of Action: Step : 4 - User Can check the

Inserting Call to Copy of Action: Step : 4 - User Can check the changes graphically in the test Name Tab. 11/5/2020 MANUAL TESTING 51

Inserting call to Existing Action: Step : 1 - Right Click on the Scripting

Inserting call to Existing Action: Step : 1 - Right Click on the Scripting area and select "Call to Existing Action“. 11/5/2020 MANUAL TESTING 52

Inserting call to Existing Action: Step : 2 - In the "Select Action" Window,

Inserting call to Existing Action: Step : 2 - In the "Select Action" Window, give the test name, Action name, description and also specify the location of the action to be inserted. 11/5/2020 MANUAL TESTING 53

Inserting call to Existing Action: Step : 3 - Once inserted, the below script

Inserting call to Existing Action: Step : 3 - Once inserted, the below script is generated exactly in the location where the action was inserted. Run. Action "Action 1", one. Iteration 11/5/2020 MANUAL TESTING 54

Inserting call to Existing Action: Step : 4 - User Can check the changes

Inserting call to Existing Action: Step : 4 - User Can check the changes graphically in the test Name Tab. 11/5/2020 MANUAL TESTING 55

Synchronization 11/5/2020 MANUAL TESTING 56

Synchronization 11/5/2020 MANUAL TESTING 56

Synchronization point is the time interface between Tool and Application under test. Synchronization point

Synchronization point is the time interface between Tool and Application under test. Synchronization point is a feature to specify delay time between one step and another of the test script. Ways to Insert Sync Point: • • • Wait. Property Exist Wait Sync(only for web based apps) Inserting QTP Inbuilt Synchronization points 11/5/2020 MANUAL TESTING 57

WAITPROPERTY Wait. Property is a method that takes the property name, Value and Timeout

WAITPROPERTY Wait. Property is a method that takes the property name, Value and Timeout value as input to perform the sync. It is a dynamic wait and hence this option is encouraged. 11/5/2020 MANUAL TESTING 58

EXIST Exist is a method that takes the Timeout value as input to perform

EXIST Exist is a method that takes the Timeout value as input to perform the sync. Again it is a dynamic wait and hence this option is encouraged. 11/5/2020 MANUAL TESTING 59

WAIT Wait is a hardcoded sync point which waits independent of the event happened

WAIT Wait is a hardcoded sync point which waits independent of the event happened or NOT. Hence usage of Wait is discouraged and can be used for shorter wait time such as 1 or 2 seconds. 11/5/2020 MANUAL TESTING 60

SYNC METHOD Sync Method can be used only for web applications where there is

SYNC METHOD Sync Method can be used only for web applications where there is always a lag between page loads. 11/5/2020 MANUAL TESTING 61

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 1 : Get into Recording Mode. This Option

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 1 : Get into Recording Mode. This Option Would be Disabled if the user is NOT in Recording Mode. Step 2 : Go to "Design" -> "Synchronization Point". Step 3 : We need to Select the object which we want to be the Sync Point. After Selecting the object, object window opens. 11/5/2020 MANUAL TESTING 62

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 4 : Click Ok, the "Add Synchronization Window"

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 4 : Click Ok, the "Add Synchronization Window" Opens up. Select the Property, Value and Time out value and click ok. 11/5/2020 MANUAL TESTING 63

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 5 : The Script would be generated as

INSERTING QTP INBUILT SYNCHRONIZATION POINTS: Step 5 : The Script would be generated as shown below which is the same as that of the Wait. Property. 11/5/2020 MANUAL TESTING 64

Default Synchronization: When user hasn't used any of the above sync methods, still QTP

Default Synchronization: When user hasn't used any of the above sync methods, still QTP has inbuild Object synchronization timeout which can be adjusted by the user. Navigate to "File" >> "Settings" >> Run Tab >> Object Synchronization Time out 11/5/2020 MANUAL TESTING 65

Checkpoints 11/5/2020 MANUAL TESTING 66

Checkpoints 11/5/2020 MANUAL TESTING 66

Checkpoints Checkpoint refers to a validation point that compares the current value for specified

Checkpoints Checkpoint refers to a validation point that compares the current value for specified properties or current state of an object with the expected value which can be inserted at any point of time in the script. 11/5/2020 MANUAL TESTING 67

Checkpoints 11/5/2020 MANUAL TESTING 68

Checkpoints 11/5/2020 MANUAL TESTING 68

Data tables 11/5/2020 MANUAL TESTING 69

Data tables 11/5/2020 MANUAL TESTING 69

Data Tables Datatable, similar to Microsoft Excel helps testers to create data driven test

Data Tables Datatable, similar to Microsoft Excel helps testers to create data driven test cases that can be used to run an Action multiple times. There are two types of Data tables. Local Data Table - Each action has its own private data table also known as local data table which is can also be accessed across actions. Global Data Table - Each test has one global data sheet that is accessible across actions 11/5/2020 MANUAL TESTING 70

Data Tables 11/5/2020 MANUAL TESTING 71

Data Tables 11/5/2020 MANUAL TESTING 71

Data Table Object Methods: 11/5/2020 MANUAL TESTING 72

Data Table Object Methods: 11/5/2020 MANUAL TESTING 72

Data Table Object Methods: 11/5/2020 MANUAL TESTING 73

Data Table Object Methods: 11/5/2020 MANUAL TESTING 73

Data Table Object Properties: 11/5/2020 MANUAL TESTING 74

Data Table Object Properties: 11/5/2020 MANUAL TESTING 74

Data Table Object Properties: 11/5/2020 MANUAL TESTING 75

Data Table Object Properties: 11/5/2020 MANUAL TESTING 75

Data table Parameter Object Properties: 11/5/2020 MANUAL TESTING 76

Data table Parameter Object Properties: 11/5/2020 MANUAL TESTING 76

Data table Parameter Object Properties: 11/5/2020 MANUAL TESTING 77

Data table Parameter Object Properties: 11/5/2020 MANUAL TESTING 77

Data Table Sheet Methods: 11/5/2020 MANUAL TESTING 78

Data Table Sheet Methods: 11/5/2020 MANUAL TESTING 78

Data Table Sheet Methods: 11/5/2020 MANUAL TESTING 79

Data Table Sheet Methods: 11/5/2020 MANUAL TESTING 79

Virtual Objects 11/5/2020 MANUAL TESTING 80

Virtual Objects 11/5/2020 MANUAL TESTING 80

Virtual Objects • Sometimes, application under test may contain standard window object but are

Virtual Objects • Sometimes, application under test may contain standard window object but are NOT recognized by QTP. • Under these circumstances objects can be defined as virtual object (VO) of type button, link etc so that user actions can be simulated on the virtual objects during execution. Creating a Virtual Object Step 1: In such scenarios, virtual Objects are created using Virtual Object Manager or New Virtual Object from "Tools" >>"Virtual Object" >> "New Virtual Object" and click "Next" Button. 11/5/2020 MANUAL TESTING 81

Virtual Objects Step 2: Map the Object against the Class Type and click "Next“.

Virtual Objects Step 2: Map the Object against the Class Type and click "Next“. 11/5/2020 MANUAL TESTING 82

Virtual Objects Step 3: Click "Mark Object" Button, cross hair cursor would appear and

Virtual Objects Step 3: Click "Mark Object" Button, cross hair cursor would appear and mark the object that you would like to map and click "Next". 11/5/2020 MANUAL TESTING 83

Virtual Objects Step 4: Selecting the parent of the Virtual object and click "Next".

Virtual Objects Step 4: Selecting the parent of the Virtual object and click "Next". 11/5/2020 MANUAL TESTING 84

Virtual Objects Step 5: Name the collection in which you would like to store

Virtual Objects Step 5: Name the collection in which you would like to store the vitual object and click "Finish". 11/5/2020 MANUAL TESTING 85

Virtual Object Manager Virtual object Manager manages the collections of Virtual objects. Testers can

Virtual Object Manager Virtual object Manager manages the collections of Virtual objects. Testers can add or Delete the Virtual Objects from the Virtual object manager. 11/5/2020 MANUAL TESTING 86

Virtual Object Limitations • • QTP doesn't support virtual objects for analog or low-level

Virtual Object Limitations • • QTP doesn't support virtual objects for analog or low-level recording. Checkpoints cannot be added on Virtual Objects. Virtual Object is NOT controlled by Object Repository. Though we map an object to a particular class (button or List), all the methods of the native objects are not supported by Virtual objects. • Object Spy cannot be used on Virtual Object. • The test execution will fail if the screen resolution changes as the co-ordinates change. • Application Window should be of same screen size so that Virtual objects are captured correctly. 11/5/2020 MANUAL TESTING 87

Error handling 11/5/2020 MANUAL TESTING 88

Error handling 11/5/2020 MANUAL TESTING 88

Error Handling There are various ways on handling errors in QTP. • Syntax Errors

Error Handling There are various ways on handling errors in QTP. • Syntax Errors • Logical Errors • Run Time Errors 11/5/2020 MANUAL TESTING 89

Error Handling Syntax Errors • Syntax errors are the typos or a piece of

Error Handling Syntax Errors • Syntax errors are the typos or a piece of the code that does not confirm with the VB scripting language grammar. • Syntax errors occur at the time of compilation of code and cannot be executed until the errors are fixed. • To verify the syntax one use the keyboard shortcut as Ctrl+F 7 and the result is displayed as shown below. If the window is NOT displayed one can navigate to "View" -> "Errors" 11/5/2020 MANUAL TESTING 90

Error Handling Logical Errors: • If the script is syntactically correct but it produces

Error Handling Logical Errors: • If the script is syntactically correct but it produces unexpected results. • Logical error usually does not interrupt the execution but produces incorrect results. Logical errors could occur due to variety of reasons, viz- wrong assumptions or misunderstanding of the requirement and sometimes incorrect program logics(using do-while instead of do-Until) or Infinite Loops. 11/5/2020 MANUAL TESTING 91

Error Handling Run Time Errors: • This kind of Error happens during Run Time.

Error Handling Run Time Errors: • This kind of Error happens during Run Time. The reason for such kind of errors is that the script trying to perform something but it is unable to do so and the script usually stops as it is unable to continue with the execution. • Examples for Run Time Errors are, 1. File NOT found but the script trying to read the file. 2. Object NOT found but script is trying to act on that particular object. 3. Dividing a number by Zero. 4. Array Index out of bounds while accessing array elements. 11/5/2020 MANUAL TESTING 92

Error Handling of Run Time Errors: 1. Using Test Settings - Error handling can

Error Handling of Run Time Errors: 1. Using Test Settings - Error handling can be defined the Test Settings by Navigating to "File" >> "Settings" >> "Run" Tab as shown below. We can select any of the specified settings and click "OK". 11/5/2020 MANUAL TESTING 93

Error Handling of Run Time Errors: 2. Using On Error Statement - On Error

Error Handling of Run Time Errors: 2. Using On Error Statement - On Error statement is used to notify the VBScript engine of intentions to handle the run-time errors by tester, rather than allowing the VBScript engine to display error messages that are not user friendly. • On Error Resume Next - On Error Resume Next informs the VBScript engine to process executing the next line of code when an error is encountered. • On error Go to 0 - This helps the testers to turn off the error handling. 3. Using Err Object - Error object is an inbuilt object within VBScript that captures the run time error number and error description with which we will be able to debug the code easily. • Err. Number - The Number property returns or Sets a numeric value specifying an error. If Err. Number value is 0 then No error had occured. • Err. Description - The Description property returns or sets a brief description about an error. • Err. Clear - The Clear method resets the Err object and clears all the previous values associated with it. 11/5/2020 MANUAL TESTING 94

Error Handling of Run Time Errors: 4. Using Exit Statement - Exit Statements can

Error Handling of Run Time Errors: 4. Using Exit Statement - Exit Statements can be used along with Err object to exit from a test or action or iteration based on the Err. Number value. Let us see each one of those Exit statements in detail. • Exit. Test - Exits from the entire QTP test no matter what the run-time iteration settings are. • Exit. Action - Exits the current action. • Exit. Action. Iteration - Exits the current iteration of the action. • Exit. Test. Iteration - Exits the current iteration of the QTP test and proceeds to the next iteration. 5. Recovery Scenarios - Upon encountering an error, recovery scenarios are triggered based on certain conditions. 6. Reporter Object - Reporter Object helps us to report an event to the run results. It helps us to identify if the concerned action/step is pass/fail. 11/5/2020 MANUAL TESTING 95

Recovery Scenarios 11/5/2020 MANUAL TESTING 96

Recovery Scenarios 11/5/2020 MANUAL TESTING 96

Recovery Scenarios Steps to create Recovery Scenario: Step 1 : Upon Clicking "New" Recovery

Recovery Scenarios Steps to create Recovery Scenario: Step 1 : Upon Clicking "New" Recovery Scenario button, the Recovery Scenario Wizard opens. 11/5/2020 MANUAL TESTING 97

Recovery Scenarios Step 2 : Next Step is to choose the Trigger Event. It

Recovery Scenarios Step 2 : Next Step is to choose the Trigger Event. It corresponds to event which arises It can be any of the below four events. • Pop-Up Window • Object State • Test Run Error • Application Crash Step 3 : Recovery Operations Window Opens. Recovery Operation can perform any of the following Operation as shown below: 11/5/2020 MANUAL TESTING 98

Recovery Scenarios Step 4 : Upon Specifying the appropriate Recovery Operation, we need to

Recovery Scenarios Step 4 : Upon Specifying the appropriate Recovery Operation, we need to specify the Post Recovery Operation. 11/5/2020 MANUAL TESTING 99

Recovery Scenarios Step 5 : Upon Specifying the Post Recovery Operation, the recovery scenario

Recovery Scenarios Step 5 : Upon Specifying the Post Recovery Operation, the recovery scenario should be named and added to the Test so that it will be activated. 11/5/2020 MANUAL TESTING 100

Recovery Scenarios Step 6 : The Recovery Scenario creation is complete and needs to

Recovery Scenarios Step 6 : The Recovery Scenario creation is complete and needs to be mapped to the current Test by checking the option "Add Scenario to the current Test" and click "Finish“. 11/5/2020 MANUAL TESTING 101

Recovery Scenarios Step 7 : The Added Recovery Scenario will be as shown below

Recovery Scenarios Step 7 : The Added Recovery Scenario will be as shown below and click on "Close" Button to continue. 11/5/2020 MANUAL TESTING 102

Recovery Scenarios Step 8 : Upon Clicking on Close Button, QTP would Pop up

Recovery Scenarios Step 8 : Upon Clicking on Close Button, QTP would Pop up user to Save the created Recovery Scenario. It will be saved with the extension. qrs and the wizard would be closed. 11/5/2020 MANUAL TESTING 103

Recovery Scenarios Verification: The Created Recovery Scenario should be part of the test now

Recovery Scenarios Verification: The Created Recovery Scenario should be part of the test now and can be verified by navigating to "File" -> "Settings" -> "Recovery" Tab. 11/5/2020 MANUAL TESTING 104

11/5/2020 MANUAL TESTING 105

11/5/2020 MANUAL TESTING 105