Recording modes in QTP
QTP supports 3 types of recording modes
1. Normal mode also called Contextual
2. Low-level recording mode
3.Analog mode
Normal Mode: It is the default recording mode and takes full advantage of QTP's Test Object Model. It recognizes objects regardless of their position on -screen. This is the preferred mode of recoding and is used for most of the automation activities.
Low-level recording mode: This mode records the exact x,y co-ordinates of your mouse operations. It is helpful in testing hashmaps. It is useful for recording objects not identified by normal mode of QTP.
Analog mode: This mode records exact mouse and keyboard 'movements' we perform in relation to the screen / application window. This mode is useful for the operation such as drawing a picture, recording signature., drag and drop operations.
Different types object Repositories in QTP (2)
QTP supports 3 types of recording modes
1. Normal mode also called Contextual
2. Low-level recording mode
3.Analog mode
Normal Mode: It is the default recording mode and takes full advantage of QTP's Test Object Model. It recognizes objects regardless of their position on -screen. This is the preferred mode of recoding and is used for most of the automation activities.
Low-level recording mode: This mode records the exact x,y co-ordinates of your mouse operations. It is helpful in testing hashmaps. It is useful for recording objects not identified by normal mode of QTP.
Analog mode: This mode records exact mouse and keyboard 'movements' we perform in relation to the screen / application window. This mode is useful for the operation such as drawing a picture, recording signature., drag and drop operations.
Different types object Repositories in QTP (2)
1) Shared Object Repository (Global)
2) Per-Action Object Repository, (Local)
Per-Action Object Repository is used by default. The extension for Per-Action repository is '*.mtr', while Shared Object Repository is preferable when dealing with dynamic objects which are called in multiple tests. The extension is '*.tsr'
Action split and the purpose of using this in QTP :
Action split is to divide an existing action into two parts.The purpose of action-split is to divide actions based on their functionality to improve code re-use.
Cross platform testing and Cross browser testing using QTP
We will need to create separate Actions which take care of different OS and Browsers
Cross Platform Testing:
Using the Built in Environment Variable we can dig up the OS information.
Eg. Platform = Environment('OS'). Then based on the Platform you need to call the actions which you recorded on that particular platform.
Cross Browser Testing:
Using this code Eg. Browser("Core Values").GetROProperty("version") you can extract the Browser and its correspondin version. Ex: Internet Explorer 6 or Netscape 5. Based on this value you call the actions which are relevant to that browser.
How will you handle SAP check-box in QTP ?
Foremost you will select SAP Add - In and launch QTP. Next step record operations on the SAP checkbox. If you face an issue while recording, you can select Tools > Object Identification > SAP checkbox object and make changes in mandatory & assertive properties to enable identification.
QTP Object Identification
QTP identifies any GUI Object based on its corresponding properties. While recording, QTP will identify and store peculiar properties (as defined in the Object Identification settings) in the object repository of the GUI object . At run-time, QTP will compare the stored property values with the on-screen properties, to uniquely identify the GUI object.
How to call from one action to another action ?
Two different ways
1) Call to copy of Action. - In this ,the Action Object Repository , Script and Datable will be copied to the destination Test Script.
2) Call to Existing Action. - In this, Object Repository , Script and Datable will NOT be copied but a call (reference) would be made to the Action in the source script.
Virtual Objects?
Your application may contain objects that behave like standard objects but are not recognized by QTP. We can define these objects as virtual objects and map them to standard classes, such as a button or a check box. QTP emulates the user's action on the virtual object during the run session. In the test results, the virtual object is displayed as though it is a standard class object.
For example, suppose we want to record a test on a Web page containing a bitmap that the user clicks. The bitmap contains several different hyperlink areas, and each area opens a different destination page. When you record a test, the Web site matches the coordinates of the click on the bitmap and opens the destination page.
To enable QTP to click at the required coordinates during a run session, you can define a virtual object for an area of the bitmap, which includes those coordinates, and map it to the button class. When you run a test, QTP clicks the bitmap in the area defined as a virtual object so that the Web site opens the correct destination page.
For more, visit - http://www.guru99.com/qtp-interview-questions.html
No comments:
Post a Comment