Search

Tuesday, October 30, 2007

QTP Question & Answers

Question: How will you check that your test cases covered all the requirements
By using traceabiltymatrix. Traceability matrix means the matrix showing the relationship b/w the requirements & testcases

1. Question: When there is a task that gets repeated in multiple scripts, what do you do in QTP?
Split the action related to that task, make it Reusable & then call that Action as many times as needed.

2 Question: what is the descriptive progrmaing?.what is the use of descriptive programming?
QTP uses it's object repository to refer to objects present in your test and which have been recorded, if you wish to use objects that were not recorded and are not present in your object repository then we use descriptive programming, where QTP does not refer to object repository but the property name and value are mentioned in the code itself for QTP to use it for e.g
this is not Desc. Prog.
Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username")
This is desc prog.
Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "Mark Twain"

3. How to add run-time parameter to a datasheet?
Datatable..addparameter ,
example,
datatable.localsheet.addparameter "Col1","Column"

4. How to load the *.vbs or test generating script in a new machine?
You can use the any one of the following two methods:1. goto : Tools --->settings --->Resources and add the .vbs file2. in the QTP script u can write : Dim App 'As ApplicationSet App = CreateObject("QuickTest.Application")App.LaunchApp.Test.Settings.Resources.Libraries.Add("")

5. How to instruct QTP to display errors and ther description in the test results instead of halting execution by throwing error in the mid of execution due to an error(for example Object not found)?
Use Exception Handling (Recovery Scenario Manager) technique of QTP: can be achieved by any one of the following two methods: 1. Using Recovery Scenario Manager2. Scripting by using: if-else-then OR Select Case

6. how to fetch test data from Database by using QTP?
In order to fetch test data from Database we have to create a adobdb connection object to connect with data base. the syntax is .... >CreateObject("Adodb.connection").

7. Question: how many types of recording modes in QTP?describe each type with an example where we use them?
There are three types of recording modes available in Quickest Pro.1.Normal mode2.Analog mode3.Low-level recording mode Normal mode: This is the default mode of recording in QTP ,Object and the Operation associated/performed with Object can be recorded. This mode takes full advantage of Quick Test's test object model, recognizing the objects in AUT regardless of their location on the screen. Analog mode: This mode records exact mouse and keyboard operations you perform in relation to the screen / application window. This mode is useful for the operation which you can record at object level, such as drawing a picture, recording signature the steps recoded using Analog mode are saved in separate data-file, Quick tests adds to your test a Run Analog file statement that calls the recorded Analog file. This file is stored with your action in which these Analog steps are created The steps recorded in Analog mode can not be edited within Quick Test. Low-level recording mode enables you to record any object or operation in your AUT whether or not Quick Test recognizes the it. This Low-level recording is useful when the exact location of an Object/operation in your AUT is important for your test .This mode records in terms of X,Y co-ordinates .Unlike in Analog mode ,the steps can be seen in Test script, a s well in Keyword view.

8. What is the file extension of the code file & object repository file in QTP?
for object repository file the extension is .tsr for code file the extension is .vbs

9. Question: How many types of Actions are there in QTP?
QTP structured by actions.actions are subprocedures which perform certain actions on application under test.
there are 2 types of actions
regular actions(non reusable actions)
reusable actions
regular actions:regular actions are used only in the script in which they were genarated.and only once.regular actions are like winrunner script.
reusable actions:actions that can be called by other actions.either(regular or reusable).
we have two types of reusable actions
external reusable actions
internal reusable actions
external reusable actions:these actions were created in another test as internal actions .and called by the given test.
internal reusable actions:these actions were created and used in the given test with in the local scope.

10. Question: Explain the concept of object repository & how QTP recognises objects?
Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). we can view or modify the test object description of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits.If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description.If no assistive properties are available, then it adds a special Ordianl identifier such as objects location onthe page or in the source code.

11. Question: How do you data drive an external spreadsheet?
Import from External Spreadsheet File by selecting Import then From File . Which imports a tabbed text file or a single sheet from an existing Microsoft Excel file into the table. The sheet you import replaces all data in the currently selected sheet of the table, and the first row in the Excel sheet replaces the column headers in the corresponding Data Table sheet. It is therefore essential that the first row of your Microsoft Excel sheet exactly matches the parameter names in your test.
If it is a Database instead of Spreadsheet by selecting Import then From Database. It imports data from the specified database to the current sheet

12. Question: How to handle dynamic objects in QTP?
QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognise the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. Check this out- If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object. While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails. The Smart Identification mechanism uses two types of properties: Base filter properties—The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value, you could no longer call it the same object. Optional filter properties—Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.

13. Question: How to handle the exceptions using recovery secnario manager in Qtp?
You can instruct QTP to recover unexpected events or errors that occured in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
There are 4 trigger events during which a recovery scenario should be activated. They are A pop up window appears in an opened application during the test run. A property of an object changes its state or value. A step in the test does not run successfully. An open application fails during the test run. These triggers are considered as exceptions and more details regarding how to use Recovery Manager is given in the QTP User Guide. Since there is hardly any space to put up snapshots.

14. What are the Features & Benefits of Quick Test Pro(QTP)..?
Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation “zero-configuration” Keyword Driven testing technology in QuickTest Professional 8.0 — allowing for fast test creation, easier maintenance, and more powerful data-driving capability Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution Collapses test documentation and test creation to a single step with Auto-documentation technology Enables thorough validation of applications through a full complement of checkpoints
1. Key word driven testing 2. Suitable for both client server and web based application 3. Vb script as the scriot language 4. Better error handling mechanism 5. Excellent data driven testing features
QTp has got so many benefits compared to Winrunner.It enables evn an inexperienced tester to work with as it is GUI based.Major advantages it has are active screen which allows user to insert cheskpoints when the application is closed,testers job is made simple with different features it has,debug viewer where in we can see wht values variables carry when the test is running,and many features made simple

15. Question: Explain in brief about the QTP Automation Object Model.
Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program

16. Question: What is a Run-Time Data Table? Where can I find and view this table?
The test results tree also includes the table-shaped icon that displays the run-time Data Table—a table that shows the values used to run a test containing Data Table parameters or the Data Table output values retrieved from a test while application test run.

17. Question: What are the different scripting languages you could use when working with QTP ?
1. VBScript 2. Jscript

18. Question: How do you test siebel application using qtp?
This answer is relevant to Siebel 7.7, and QTP 8.0. To test Siebel using QTP, you will need two components.
1. The Siebel Addin from Mercury for QTP (install this on the system with QTP on it).
2. The Test Automation Framework license keys from Siebel (install the license key on the Siebel server).
Now you will need to enable the automation API on the Siebel server. To do this,
The [SWE] section of the server .cfg file needs to be updated with the entries below
[SWE]
...
EnableAutomation = TRUE
AllowAnonUsers = TRUE
...
The Siebel server needs to be restarted after this change.
You can now test Siebel from QTP by using the Siebel Addin.

19. Question: What is the difference between check point and output value.
Check point is a verification point that compares a current value for a specified property with the expected value for that property. An outPut value is a value captured during the test run and entered in the run-time table which can be used as an input for another statement.

20. Question: What are the properties you would use for identifying a browser & page when using descriptive programming ?
"name" would be another property apart from "title" that we can use. ex: Browser("name:="xxx"").page("name:="xxxx"")..... OR We can also use the property "micClass". ex: Browser("micClass:=browser").page("micClass:=page")....

21. Question: Differentiate the two Object Repository Types of QTP.
In Qtp there are 2 object repositories, they are1.Shared Object Repository2.Per Action Mode,by default it's per action mode.we will use shared OR for calling a particular action,it's like calling external libraries.we will use per action for a particular action ie, for one action only.

22. Question: Explain the concept of how QTP identifies object.

QTP uses the Object Repository file to recognize objects on the application. When QTP runs a action, it uses the Object Repository to locate objects. It reads an object’s description in the Object Repository and then looks for an object with the same properties in the application being tested
During recording qtp looks at the object and stores it as test object.For each test object QT learns a set of default properties called mandatory properties,and look at the rest of the objects to check whether this properties are enough to uniquely identify the object. During test run,QT searches for the run time obkects that matches with the test object it learned while recording.

23. Question: What is the difference between Call to Action and Copy Action.?
Call to Action : The changes made in Call to Action , will be reflected in the orginal action( from where the script is called).But where as in Copy Action , the changes made in the script ,will not effect the original script(Action)
when u insert a call to action,they r read only in the calling test.It can be modified in the original test.where as come to copy action,you can make changes to the copied action,your changes will not effect the original action where it created.

24. Question: Explain the keyword createobject with an example.
Creates and returns a reference to an Automation object syntax: CreateObject(servername.typename [, location]) Arguments servername:Required. The name of the application providing the object. typename : Required. The type or class of the object to create. location : Optional. The name of the network server where the object is to be created.
create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by microsoft). ex: set oDesc= createobject(Excel.application) odesc.activeworksheet=1

25. To which environments does QTP supports ? QuickTest 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.

26. Explain QTP Testing process ? The QuickTest testing process consists of 6 main phases: Create your test plan Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application. Recording a session on your application As you navigate through your application, QuickTest graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form. Enhancing your test Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test. Debugging your test If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption. Running your test on a new version of your application You run a test to check the behavior of your application. While running, QuickTest connects to your application and performs each step in your test. Analyzing the test results You examine the test results to pinpoint defects in your application. Reporting defects As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

27. Explain the check points in QTP? A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. A page checkpoint checks the characteristics of a Application A text checkpoint checks that a text string is displayed in the appropriate place on a Application. An object checkpoint (Standard) checks the values of an object on a Application. An image checkpoint checks the values of an image on a Application. A table checkpoint checks information within a table on a Application An Accessiblity checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site

28. What is Parameterizing Tests? When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.