Saturday, March 26, 2011

QTP 9.2 QnA Part-II


Question 16- What is Smart Identification in QTP
Answer- Due to dynamic changes in properties QTP does not recognize the object with the help of the Properties present in the object repository then QTP use the special mechanism to identify the object smartly with base filter and optional filter properties. This mechanism is known as smart identification.
Due to this script does not fail but it proceeds ahead to compare the next property

Question 17- What is synchronization in QTP?
Answer- If you do not want QTP to perform a step or checkpoint until an object in your application achieves a certain status, you should insert a synchronization point to instruct QuickTest to pause the test until the object property achieves the value you specify (or until a specified timeout is exceeded).

So as a summary we can say, Synchronization makes available specific time for an object to process prior to moving on to next step.

Question 18- What are the Synchronization methods in QTP?
Answer- In QTP Synchronization can be inserted in three different ways:
1- By adding Synchronization Point. To add a synchronization point, Place cursor in desired location>keep tool under recording mode>Insert menu>Synchronization point >show the object >click ok>select property name & Value (True)>enter >click ok>Stop recording.

2- Increasing Default Checkout Time. To do this go to File menu--> Setting--> Run Tab--> Change timeout --> Click Apply--> Click OK.

3- Wait statement- pause the test for fixed time specified in the wait statement.
Syntax: Wait(time in seconds)


Question 19- Explain the checkpoints in QTP.
Answer- A checkpoint is a step that compares two values and reports the result. It captures the expected result of an Object while recording and compare with the expected results during run session. It returns the pass or fails status accordingly.
In QTP 9.2 following are checkpoints:

1- Standard Checkpoints: - It checks the state of an object property, such as button, checkbox, radio button, and combo boxes ECT. A Table check point can be created by inserting standard check point on table object. And in same way a page checkpoint can be created by inserting standard checkpoint on page object. And also an Image checkpoint can be created by inserting a standard checkpoint on an image object.

2- Text Checkpoints: - It checks the text displayed on your application or web page. Suppose you want to check this text "Host is created successfully", you can also create customized checkpoint like you can configure that checked text is "created", before text is "Host is" and after text is "successfully”.

3- Text Area Checkpoints: - It checks the text displayed on your application or web page on specific area. You can check existence of the text string on a particular area.

4- Bitmap Checkpoints: - It does a pixel to pixel comparison of an image or part of an image. Bitmap check point is rarely used, and mostly used on graphics websites and applications.

5- Database Checkpoints: - It checks the content of data base accessed by your application.  You can check the whole database which resides in your web page using this checkpoint.

6- Accessibility Checkpoints: - Accessibility Checkpoint recognizes the areas of your Web Site that may not conform to the World Wide Consortium (W3C) Web Content Accessibility guidelines.

7- XML checkpoints (From Resource):- It checks the data content of XML documents in XML files or XML documents in Web pages and frames.

XML checkpoint (From Resource) - It is supported for all add-in environments. (web,vb,ActiveX)

XML checkpoint (From Application) - It is supported for only web add-in environment.

Question 20- What is difference between an image checkpoint and bitmap checkpoint.
Answer- Image checkpoint verify the properties of an Image in a web page..like the location of the Image in a web page is correct or not. Alos this is supported in web environment only.
                                                                                                                      
Where Bitmap checkpoint verify the variation of the object between new build and old build. And this is supported in all testing environment.

Question 21- How we can identify if any checkpoint is failed.
Answer- A Failed checkpoint is indicated in the TEST Results with a red X. The TEST RESULTS will show the expected value and actual value of the property or properties Checked.

Question 22- What is use of regular expression in QTP?
Answer- Regular expressions enable QuickTest to identify objects and text strings with varying values. You can use regular expressions when:
1- Defining the property values of an object in dialog boxes or in programmatic descriptions
2- Parameterize a step
3- Creating checkpoints with varying values          
For example, you can use a regular expression if you want to create a text checkpoint on a date text string, but the displayed date changes according to the current date. If you define the date as a regular expression, the checkpoint checks that the captured text string matches the expected date format, rather than checking the exact date value.

You can use regular expressions only for values of type string.
 

Question 23- What are the different types of parameters used in QTP?
Answer-
1- Input parameters: - Input parameters enable you to run a test using different sets of input values. Means, it allow you to replace a static value with dynamic placeholder (parameter). The values of input parameter are inputs into application from external data sources.

2- Output Parameters: - Enables you to to capture output values from the application at run-time. You can get a value from the application and store it in the QuickTest test Results. You can later use this value as an input to a variable. Capturing a value during run-time and using it as an input variable in your test is called data correlation.

3- Random Number parameters: - The random number input Parameter generates random numbers and uses them as input value for a parameter. By default, the random number ranges between 0 and 100.

4- Environment parameters: - ENVIRONMENT Parameters enable you to insert a value in your Test from an environment variable list. The value of an environment Parameter remains the same during the test playback, regardless of the number of Iterations, unless you change the value.


Question 24- What is an action and what types of actions are used in QTP?
Answer- Action is nothing but a piece of code/script written Test some part of functionality in the Application under test. Combination of Actions can be called as a test. These actions can be used in other tests if they need.
There are three types of action used in QTP:
1- Reusable action:- This can be used in any test by calling it into that test. Tester should create an action as Reusable if he thinks this can be used in other tests.

2- Non Reusable action:- This can be used in a single test. By default actions are non-reusable.

3- External action:- External Actions are those which are called from External Test and these Actions are Read-only. While re usable action can be called and modifies in a test.


Question 25- What is recovery scenario in QTP?
Answer: - While executing your scripts you may get some UNEXPECTED errors. To "recover" the test (and continue running) from these unexpected errors you use Recovery Scenarios.
Recovery scenarios are useful when it is difficult to predict at which step the errors can come or when we are confident that the error will not come in the QTP script, whereas it can be anywhere outside the QTP Script.
In order to handle such situations QTP comes to our rescue by creating recovery scenarios and associates them with the particular tests.
The Recovery Scenario Manager presents a structured wizard which helps us in defining the recovery scenario, like detailed definition of the unexpected event and the operations required to recover from the exception during the run session.

The events for we can use recovery scenarios:
1- Application Crash
2- Pop Up Window
3- Test Run Error
4- Object State

Question 26- What constitute Recovery Scenarios?
A recovery scenario consists of the following:
1- Trigger Event- The event that interrupts your run session. For example, a window that may pop up on screen, or a QTP run error.

 2- Recovery Operations- The operations to perform to enable QTP to continue running the test after the trigger event interrupts the run session. For example, clicking an OK button in a pop-up window, or restarting Microsoft Windows.

 3- Post-Recovery Test Run Option- The instructions on how QTP should proceed after the recovery operations have been performed, and from which point in the test QTP should continue, if at all. For example, you may want to restart a test from the beginning, or skip a step entirely and continue with the next step in the test.

QTP 9.2 QnA Part-I


Question 1- What are the Benefit of automation testing
Answer- As a summary automation testing offers following advantages which manual testing does not
1- Reusability
2- Consistency
3- Productivity

Question 2- What is the general workflow of QTP
Answers- step by step workflow is:
1-      Prepare the automation test environment
2-      Record user action to generate the basic test
3-      Enhance the automation test for play back and testing
4-      Run test/multiple test

Question 3- What is keyword view and Expert view in QTP?
Answer- keyword views shows exact recording of the applications (in tabular format) and the interface divided into
1)item
2)operation
3)value
4)documentation

while in expert view VB Scripting is displayed.

Question 4- To which environments does a QTP support?
Answer- Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web,..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.


Question 5- What is Add-in manager in QTP?
Answers- When you launch your QTP, you will find an option called "add-in-manager" there you can load your add-in. It depends on your license that what the list of add-in coming there. By default in QTP 9.2 three Ad-ins comes and these are: ActiveX, Visual Basic and Web. IF none of the add-ins are checked in the Add in Manager of QTP then Standard Windows Environment will be loaded by default.

Question 6- Why do you select Allow Other Mercury Products To Run Tests And Components?
Answer- If you want to run test from QC test lab you need to enable this option.

Question 7- What access permissions do the test and testers to have?
Answer-
• Database
• Host systems
• Input/output data

Question 8- What are the different framework we can use using QTP?
Answer- There are different types of framework we use in QTP.
1. Datadriven framework
2. Keyword driven framework
3. Module driven framework
4. Hybrid driven framework

1- Datadriven framework- This frame work is used when an application is test with multiple sets of data. The data is passed to the scripts from data files like excel files, csv files, ODBC (Open Database Connectivity) and ADO (ActiveX Data Objects) objects
In other words, The Execution of an automation program on a software build with multiple test data is called as "data driven testing"

2- Keyword driven framework- Keyword-driven testing is a testing methodology where every action to be performed is described by a keyword. All these keywords defines the object, the action works with. These keywords are also called actions or commands.
The keywords based testing is a kind of alternative of scripting.


Question 9- What are different modes of recording in QTP?
Answer- there is three modes of recording in QTP
1-      Normal
2-      Analog
3-      Low level

1-      Normal Mode- It’s a default recording mode. It is also called Context Sensitive Recording. In QTP we generally use over 95% of recording in this mode only.
It is used to record the operations on standard GUI objects. For each and every operation it generates script. In this mode QTP learns the properties of an object and stores them in the object repository for object identification at run time.

2-      Analog Mode- In this we can records the exact mouse and keyboard operations performed in relation to either the screen or the application window.

3-      Low level Mode- This mode enables you to record on any object in your application, irrespective of  QTP recognizes the specific object or the specific operation.


Question 10- What are the different run modes in QTP?
Answer- there is three run modes
1- Verify: - to save the results of the test run to compare and verify with the future runs of the same test
2- Debug: - to save the results as he is yet to finish the script or he is testing his QTP coding logic
3- Update:- to update the expected results while running the test, say for example while recording the script the calendar date was 10/20/2002 and while executing the test it is a different date (system date), then the test should be run in the update mode other wise the test would fail because of the changed properties of the object.

Question 11- What is the concept of object and in QTP?
Answer- In general Object is an instance of a class and each object has properties and methods. Now in QTP all these objects are stored in a Object repository. There are some predefined object stored are called slandered objects and can not be changes or modified.
There are two types of Object
1-      Test Object :- A test object is an object which created by QTP in the test correspond to actual object in the application. This stored information will be used by QTP at the time of run session to identify and check the object
2-      Run time Object:- Now the real object in the application on which the method are performed at the time of run, are called Run time objects.

Question 12- What is the object repository in QTP?
Answer- Object repository is the storage space for Objects. OR works as interface between application and tool. Any OR generally consists of:
1- Logical Name- A name given to the object
2- Physical description- The object detail or u can say the properties of the object which is used to identify this object during run time.

Question 13- What are the two types of repository in QTP?
Answer- In QTP there are 2 object repositories, they are

1.Shared Object Repository (Global Object Repository)- A shared object repository stores test objects in a file that can be accessed by multiple components (via their application areas) in read-only mode.
The extension for such OR is “.tsr”   -- Test Script Repository


2.Local Object Repository (Per-action repository)- A local object repository stores objects in a file that is associated with one specific component, so that only that component can access the stored objects.
By default it’s a local object repository. Whenever we create an action, an object repository is created by default for this action.
The extension for such OR is  “.mtr”  -- Modular Test Repository or mercury test repository


Question 14- What is Object spy and how it is used?
Answer- Object spy is used view the run & test time object properties & methods of the application under test.
To select object spy navigate to tool bar and select object spy or In the Object Repository Window Click the Object Spy Icon. Once spy is selected a hand will come. Once you click on an object all the properties of the object is listed in the Object Spy Window


Question 15- How Quick Test Recognizes Objects?
Answer- QTP recognizes all objects in the Application under test using the set of mandatory properties that it stores for all Test Objects while recording. If QTP is not able to recognize the objects using the set of mandatory properties it uses another set of properties called the assistive properties. Incase the assistive properties are also not enough to uniquely identify an object QTP resorts to using the ordinal identifiers for the object that are properties like the index location and time of creation of the object. If all this fails, QTP resorts to the smart identification mechanism.