Monday, November 7, 2011

QTP Frequently Asked Questions(FAQ)

Q. Have you ever written a compiled module? If yes tell me about some of the functions that you wrote.
A. I Used the functions for Capturing the dynamic data during runtime. Function used for Capturing Desktop, browser and pages.

Q. What projects have you used WinRunner on? Tell me about some of the challenges that arose and how you handled them.
A. pbs :WR fails to identify the object in gui. If there is a non std window obk wr cannot recognize it ,we use GUI SPY for that to handle such situation.

Q. Can you do more than just capture and playback?
A. I have done Dynamically capturing the objects during runtime in which no recording, no playback and no use of repository is done AT ALL. -It was done by the windows scripting using the DOM (Document Object Model) of the windows.

Q. How long have you used the product? How long have you used the product?
A. Yes, there's an in-built functionality called "Step Generator" in Insert->Step->Step Generator -F7, which will generate the scripts as u enter the appropriate steps.
Q. What is the difference between check point and output value.
A. An outPut value is a value captured during the test run and entered in the run-time but to a specified location. EX:-Location in Data Table[Global sheet / local sheet]

Q. Discuss QTP Environment.
A. Quick Test Pro environment using the graphical interface and Active Screen technologies - A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.


Q. Explain the concept of how QTP identifies object.
A. 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 objects that matches with the test object it learned while recording.

Q. Differentiate the two Object Repository Types of QTP.
A. Object repository is used to store all the objects in the application being tested.2 types of object repository per action and shared. In shared repository only one centralized repository for all the tests. Where as in per action. for each test a separate per action repository is created.


Q. What the differences are and best practical application of each.
A. Per Action: For Each Action, one Object Repository is created.
Shared : One Object Repository is used by entire application

Q. Explain what the difference between Shared Repository and Per Action Repository
A. Shared Repository: Entire application uses one Object Repository, that similar to Global GUI Map file in Win Runner
Per Action: For each Action, one Object Repository is created, like GUI map file per test in Win Runner

Q. Explain in brief about the QTP Automation Object Model.
A. Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test 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 Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program.


Q. How to handle dynamic objects in QTP?
A. 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 recognize 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 Quick Test 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 Quick Test 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 Quick Test 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.

Q. What is a Run-Time Data Table? Where can I find and view this table?
A. In QTP, there is data table used , which is used at runtime.
-In QTP, select the option View->Data table.
-This is basically an excel file, which is stored in the folder of the test created, its name is Default.xls by default.


Q. How does Parameterization and Data-Driving relate to each other in QTP?
A. To datadrive we have to parameterize. i.e. we have to make the constant value as parameter, so that in each iteration(cycle) it takes a value that is supplied in run-time data table. Through parameterization only we can drive a transaction (action) with different sets of data. You know running the script with the same set of data several times is not suggestible, & it's also of no use.

Q. What is the difference between Call to Action and Copy Action?
A. Call to Action: The changes made in Call to Action , will be reflected in the original 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)

Q. Explain the concept of object repository & how QTP recognizes objects?
A. 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.
Quick test 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 Ordinal identifier such as objects location on the page or in the source code.


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

Q. What are the different scripting languages you could use when working with QTP ?
A. Visual Basic (VB),XML, JavaScript, Java, HTML

Q. Few basic questions on commonly used Excel VBA functions.
A. common functions are:
Coloring the cell
Auto fit cell
setting navigation from link in one cell to other
saving

Q. Explain the keyword createobject with an example.
A. Creates and returns a reference to an Automation object
syntax: Create Object (server name. Type name [, 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.

Q. How to handle the exceptions using recovery secnario manager in Qtp?
A. 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

Q. what is the use of Text output value in Qtp?
A. Output values enable to view the values that the application talkes during run time.When paramaterised, the values change for each iteration.Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.

Q. How to use the Object spy in QTP 8.0 version?
A. There are two ways to Spy the objects in QTP
1) Thru file toolbar
---In the File ToolBar click on the last toolbar button (an icon showing a person with hat).
2) Tru Object repository Dialog
---In Objectrepository dialog click on the button"object spy..."
In the Object spy Dialog click on the button showing hand symbol.
the pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object
if at all the object is not visible..or window is minimised then Hold the Ctrl button and activate the required window to and release the Ctrl button.

Q. What is the file extension of the code file & object repository file in QTP?
A. File extension of
-- Per test object rep :- filename.mtr
-- Shared Oject rep :- filename.tsr
Code file extension id script.mts

Q. Any limitation to XML Checkpoints?
A. Mercury has determined that 1.4MB is the maximum size of a XML file that QTP 6.5 can handle

Q. How to make arguments optional in a function?
A. this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required.

Q. How to covert a String to an integer?
A. CInt()---> a conversion function available.

Q. Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?
A. Inserting a call to action will only Import the columns of the Action called

Q. What are the Features & Benefits of Quick Test Pro (QTP)..?
A. 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

Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed

/qtp/qtpfaq25.asp, line 94

800401f3

Q. How to supress warnings from the "Test results page"?
Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".


Q. When we try to use test run option "Run from Step", the browser is not launching automatically why?
A. This is default behaviour.

Q. Does QTP is "Unicode" compatible?
A. QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatible by end of December 2004.

Q. How to "Turn Off" QTP results after running a Script?
A. Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.

Q. How to verify the Cursor focus of a certain field?
A. Use "focus" property of "GetRoProperty" method"

Q. How to handle Run-time errors?
A. (a) On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure.
Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext

Q .How to change the run-time value of a property for an object?
A. SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set

Q. How to retrieve the property of an object?
A. using "GetRoProperty".

Q. How to open any application during Scripting?
A. SystemUtil , object used to open and close applications and processes during a run session.
(a) A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test
E.g : SystemUtil.Run "Notepad.exe"
SystemUtil.CloseDescendentProcesses ( Closes all the processes opened by QTP )

Q. Types of properties that Quick Test learns while recording?
A. (a) Mandatory (b) Assistive .
In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, Quick Test can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables Quick Test to create a unique description when the mandatory and assistive properties are not sufficient to do so.

Q. Checking Bitmaps:
A. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space.
When you run the test or component, Quick Test compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, Quick Test captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy. For more information on test results of a checkpoint, see Viewing Checkpoint Results.
For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded).
Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.


Q. Text/Text Area Checkpoint .
A. In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions.

Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint.

Quick Test automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed).

To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens

Checking XML :

XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data.

XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.

You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below:

An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another.
An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.
XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way.
XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.






Q. Object Repositories types, Which & when to use?

Deciding Which Object Repository Mode to Choose

To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes.

In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions:

You have only one, or very few, tests that correspond to a given application, interface, or set of objects.

You do not expect to frequently modify test object properties.

You generally create single-action tests.

Conversely, the shared object repository mode is generally the preferred mode when:

You have several tests that test elements of the same application, interface, or set of objects.

You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.

You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

Q. Can we Script any test case with out having Object repository? or Using Object Repository is a must?
A. No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the
objects logical names and properties available.

Q. How to execute a WinRunner Script in QTP?
A. a. TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward compatibility
Parameters : The test set within Quality Center, in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center project. When the test is not saved in Quality Center, this parameter is ignored.
e.g : TSLTest.RunTest "D:\test1", ""
b. TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue"
CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends.
Parameters : Up to 15 WinRunner function argument

Q. 3 differences between QTP & Winrunner?
A. (a) QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting.
(b) QTP supports ".NET" application Automation not available in Winrunner
(c) QTP has "Active Screen" support which captures the application, not available in WR.
(d) QTP has "Data Table" to store script values , variables which WR does not have.
(e) Using a “point and click” capability you can easily interface with objects, their
definitions and create checkpoints after having recorded a script – without having
to navigate back to that location in your application like you have to with WinRunner.
This greatly speeds up script development.

Q.How to add a runtime parameter to a datasheet?
A. DataTable.LocalSheet
The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it.
MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45")

Q.What scripting language is QTP of ?
A. Vbs

Q. Analyzing the Checpoint results
Standard Checpoint :By adding standard checkpoints to your tests or components, you can compare the expected values of object properties to the object's current values during a run session. If the results do not match the checkpoint fails.

Q.Table and DB Checkpoints
A. By adding table checkpoints to your tests or components, you can check that a specified value is displayed in a cell in a table on your application. By adding database checkpoints to your tests or components, you can check the contents of databases accessed by your application.The results displayed for table and database checkpoints are similar.

When you run your test or component, QuickTest compares the expected results of the checkpoint to the actual results of the run session. If the results do not match, the checkpoint fails.You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component. For ActiveX tables, you can also check the properties of
the table object. To add a table checkpoint, you use the Checkpoint Properties dialog box.
Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments.
You can use database checkpoints in your test or component to check databases accessed by your
Web site or application and to detect defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query.
Database checkpoints are supported for all environments supported by QuickTest, by default, as well as for a variety of external add-in environments.
There are two ways to define a database query:
(a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office.
(b) Manually define an SQL statement.
The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint


Q. what do you call the window testdirector-testlab?
A. "Execution Grid". It is place from where we Run all Manual / Automated Scripts

Q. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
A. You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location.
Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run.

Q. How to Import data from a ".xls" file to Data table during Runtime.
A. Datatable.Import "...XLS file name..."
DataTable.ImportSheet(FileName, SheetSource, SheetDest)
DataTable.ImportSheet "C:\name.xls" ,1 ,"name"

Q.How to export data present in Datatable to an ".xls" file?
A. DataTable.Export "....xls file name..."

Q. Syntax for how to call one script from another? and Syntax to call one "Action" in another?
A. RunAction ActionName, [IterationMode , IterationRange , Parameters] Here the actions becomes reusable on making this call to any Action. IterationRange String Not always required. Indicates the rows for which action iterations will be performed. Valid only when the IterationMode is rngIterations. Enter the row range (i.e. "1-7"), or enter rngAll to run iterations on all rows. If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument.

Q. What is the Diff between Image check-point and Bit map Check point?
A. Image checkpoints enable you to check the properties of a Web image.
You can check an area of a Web page or application as a bitmap. While
creating a test or component, you specify the area you want to check by
selecting an object. You can check an entire object or any area within an
object. QuickTest captures the specified object as a bitmap, and inserts a
checkpoint in the test or component. You can also choose to save only the
selected area of the object with your test or component in order to save disk Space
For example, suppose you have a Web site that can display a map of a city
the user specifies. The map has control keys for zooming. You can record the
new map that is displayed after one click on the control key that zooms in
the map. Using the bitmap checkpoint, you can check that the map zooms
in correctly.
You can create bitmap checkpoints for all supported testing environments
(as long as the appropriate add-ins are loaded).
Note: The results of bitmap checkpoints may be affected by factors such as
operating system, screen resolution, and color settings.

Q. How many ways we can parameterize data in QTP ?
A. There are four types of parameters:
Test, action or component parameters enable you to use values passed
from your test or component, or values from other actions in your test.

Data Table parameters enable you to create a data-driven test (or action)
that runs several times using the data you supply. In each repetition, or
iteration, QuickTest uses a different value from the Data Table.

Environment variable parameters enable you to use variable values from
other sources during the run session. These may be values you supply, or
values that QuickTest generates for you based on conditions and options
you choose.

Random number parameters enable you to insert random numbers as
values in your test or component. For example, to check how your
application handles small and large ticket orders, you can have QuickTest
generate a random number and insert it in a number of tickets edit field.

Q. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
A. Batch Testing in WR is nothing but running the whole test set by selecting "Run Testset" from the "Execution Grid". The same is possible with QTP also. If our test cases are automated then by selecting "Run Testset" all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in "Waiting" mode.

Q. If I give some thousand tests to execute in 2 days what do u do?
A. Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.

Q.what does it mean when a check point is in red color? what do u do?
A. A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Envronment Issue or a Application issue.

Q. If an application name is changes frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handles?
A. QTP handles those situations using “Regular Expressions”.

Q. What is Parameterizing Tests?
A. 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.

Q. What is test object model in QTP ?
A) The test object model is a large set of object types or classes that QuickTestuses to represent the objects in your application. Each test object class has alist of properties that can uniquely identify objects of that class and a set ofrelevant methods that QuickTest can record for it.A test object is an object that QuickTest creates in the test or component torepresent the actual object in your application. QuickTest stores informationabout the object that will help it identify and check the object during therun session.A run-time object is the actual object in your Web site or application onwhich methods are performed during the run session.When you perform an operation on your application while recording,QuickTest:➤ identifies the QuickTest test object class that represents the object on whichyou performed the operation and creates the appropriate test object➤ reads the current value of the object’s properties in your application andstores the list of properties and values with the test object➤ chooses a unique name for the object, generally using the value of one of itsprominent properties➤ records the operation that you performed on the object using theappropriate QuickTest test object methodFor example, suppose you click on a Find button with the following HTMLsource code:QuickTest identifies the object that you clicked as a WebButton test object.It creates a WebButton object with the name Find, and records the followingproperties and values for the Find WebButton:It also records that you performed a Click method on the WebButton.QuickTest displays your step in the Keyword View like this:QuickTest displays your step in the Expert View like this:Browser("Mercury Interactive").Page("Mercury Interactive").WebButton("Find").Click

Q. What is Object Spy in QTP?
A. Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.

Q. Supported Check-Points in QTP?


Q. IF we use batch testing. the result shown for last action only. in that how can i get result for every action.
A. u can click on the icon in the tree view to view the result of every action


Q. How the exception handling can be done using QTP
A. It can be done Using the Recovery Scenario Manager which provides a wizard that gudies you through the process of defining a recovery scenario. FYI.. The wizard could be accessed in QTP> Tools-> Recovery Scenario Manager .......

Q. How many types of Actions are there in QTP?
A. There are three kinds of actions:
non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once.
reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests.
external action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.

Q. I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this?
A. U can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad "( i.e., where the notepad.exe is stored in the system) in the "Windows Applications Tab" of the "Record and Run Settings window.

Q. How do you plan test automation?
1. Prepare the automation Test plan
2. Identify the scenario
3. Record the scenario
4. Enhance the scripts by inserting check points and Conditional Loops
5. Incorporated Error Handler
6. Debug the script
7. Fix the issue
8. Rerun the script and report the result.

Q. Explain about the Test Fusion Report of QTP ?
A) Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.

Q. To which environments does QTP supports ?
A) 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.


Q. What is QTP ?
A) Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications...


Q. Explain QTP Testing process ?
A) The Quick Test testing process consists of 6 main phases: 1. Create your test planPrior 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.2. Recording a session on your application As you navigate through your application, Quick Test 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. 2. Enhancing your test o 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.o 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. o Adding logic and conditional statements to your test enables you to add sophisticated checks to your test. 3. Debugging your test If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption. 4. 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. 5. Analyzing the test results You examine the test results to pinpoint defects in your application. 6. Reporting defects As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.









Q.Explain the QTP Tool interface.
A)

It contains the following key elements:
Title bar, displaying the name of the currently open test
Menu bar, displaying menus of Quick Test commands
File toolbar, containing buttons to assist you in managing tests
Test toolbar, containing buttons used while creating and maintaining tests
Debug toolbar, containing buttons used while debugging tests.
Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View > Toolbars > Debug. Note that this tutorial does not describe how to debug a test. For additional information, refer to the Quick Test Professional User's Guide.
Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow.
Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View > Toolbars > Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. For additional information, refer to the Quick Test Professional User's Guide.


Test pane, containing two tabs to view your test-the Tree View and the Expert View
Test Details pane, containing the Active Screen
Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test
Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.)
Status bar, displaying the status of the test

Q. How to configure which add-ins will be loaded when working with Quality Center?
A. Note: From QTP 6.5 version the test is opened with the correct add-ins, the settings below can be used with older versions.
When Quality Center launches Quick Test Professional to run tests, then by default QTP is loaded with all add-ins which are installed on the machine. If you want QTP to be loaded with the last add-ins configuration which was opened on this specific machine you should change the following value in the registry of the machine which QTP is running on:
[HKEY_CURRENT_USER\Software\Mercury Interactive\Quick Test Professional\MicTest\AddIn Manager]
"SilentModeWithPredefinedAddIns"=dword:0000001
Q. How to open Quality Center connection dialog faster?
A. You can launch the Quality Center connection dialog by double clicking on the right pane of the status bar of either QuickTest or the Report. Q. How do I use QuickTest together with Quality Center? A. Quality Center is a powerful test management tool that enables you to manage and control all phases of software testing. It provides a comprehensive view of the testing process so you can make strategic decisions about the human and material resources needed to test an application and repair defects.
Quality Center and QuickTest work together to integrate all aspects of the testing process. In QuickTest, you can create tests and save them in your Quality Center project database. After a test has been run, the results are viewed and analyzed in Quality Center.
For more information on using Quick Test and Quality Center together, please refer to the Quick Test User's Guide.
Q. How Does Run time data (Parameterization) is handled in QTP?
A. You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.

Q. What is keyword view and Expert view in QTP?
A. Quick Test’s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

Q. How to access the HTML tags directly?

A. QuickTest provides direct access to the browser's Document Object Model (DOM) through which you may access the HTML tags directly. Access to the DOM is done using the .Object notation. You can find more information about the DOM on the Microsoft Web Workshop web site.
The test below demonstrates how to iterate over all the tags in the page. The test then outputs the inner-text of the tags (the text contained between the tags) to the report using the Reporter object.
' We need the on error because not all the elements have inner-textOn Error Resume NextSet Doc = Browser("CNN Interactive").Page("CNN Interactive").Object' Loop through all the objects in the pageFor Each Element In Doc.all TagName = Element.TagName ' Get the tag name InnerText = Element.innerText ' Get the inner text ' Write the information to the report Reporter.ReportEvent 0, TagName, InnerText Next


Q. Where can I find a web page's cookie?
A. The cookie used by the browser may by accessed through the browser's Document Object Model (DOM). The following example returns the cookie collection from the browser. You can find more information about the DOM on the Microsoft Web Workshop web site.
Browser("Flight reservations").Page("Flight reservations").Object.Cookie

Q. How to change the template test which is used by Quality Center to create new tests?
A. When creating a new test from Quality Center, the test is based on a template test which is located under "bin/TD2000" directory under the "Test Director Plugins" installation.
You can replace this test to contain the test template that you wish to be used.
Note that if you change the test to use a Quick Test Professional 6.0 (or later) template test then this test can not be opened in Astra LoadTest 5.x
Q. How to change the manual template test which is used by Quality Center when converting manual tests to Quick Test test?
A. When you have a manual test defined in Quality Center and you want to create from it an automatic test, you can control the way this automatic test will be created.
You can edit the ManualTemplate.txt file located under "bin/TD2000" directory under "Test Director Plugins" installation to contain the steps which you want to be generated in the QTP test for each manual step.
Q. How to close Quick Test after runs when running from Quality Center?
A. When running multiple Quick Test Professional tests from Quality Center you can specify that you want to close QTP after specific amount of tests which are executed.
To do so, you should add to the end of the mic.ini file (located under the bin directory of QTP installation) the following lines:
[RemoteAgent]
CloseToolAfterRuns=
Q. How to record on non standard menus?

A. In QuickTest Professional 8.0 you can decide how do you want QuickTest to behave while recording on menus from the UI.This option is available in the "Advanced Windows Application Options" dialog to be found underTools > Options > Windows Applications > Advanced.
More information can be found in the QuickTest User's Guide

Q. How to terminate an application that is not responding? A. You can terminated any standard application while running a script in QuickTest.If you want to terminate the application, just set this line:
SystemUtil.CloseProcessByName "app.exe"
or
SystemUtil.CloseProcessByWndTitle "Some Title"
Q. Where can I find information on the IE Document Object Model?
A. You can find more information on the IE DOM in the following links:
Document object: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_document.asp
Other HTML Objects: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects.asp
General DHTML reference: http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
Q. How to configure Quick Test to record on Embedded HTML Controls?
A. In order to be able to record context sensitive operations on Embedded HTML Controls (an application which contains an embedded IE HTML viewer), you will need to set the following
Add to the ie_hook section in mic.ini (located under Quick Test bin directory) the following lines:
[ie_hook]
myapp.exe=yes (where myapp.exe is the executable name of the application you want to test)
you should change the following setting in the registry:
[HKEY_CURRENT_USER\Software\Mercury Interactive\Quick Test Professional\MicTest\Hooks\myapp.exe]
"bbHook"=dword:00000001"GetMessageHook"=dword:00000001"WndProcHook"=dword:00000001
Q. How do I launch a new browser from a test?
A: A new browser window (and any other application) can be launched from within a test by adding the following step to your test:
SystemUtil.Run "iexplore.exe", "http://www.mercuryinteractive.com"
Q.How do I make the test prompt the user for input while it is running?

A. The VBScript InputBox function allows you to display a dialog box that prompts the user for input and then continue running the test. You can use the value that was entered by the user later on in the test. See the VBScript reference manual for more information on the InputBox function.
The following example shows the InputBox function used to prompt the user for the password.
Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username").Set "administrator"Passwd = inputbox ("Enter password", "User Input")Browser("Mercury Tours").Page("Mercury Tours").WebEdit("password").Set Passwd

Q. How to remove result files from old tests?
You can use the Test Results Deletion Tool to view a list of all the test results in a specific location in your file system or in a Quality Center project. You can then delete any test results that you no longer require.
The Test Results Deletion Tool enables you to sort the test results by name, date, size, and more, so that you can easily identify the results you want to delete.
You can find this utility in the Start Menu > QuickTest Professional > Tools > Test Results Deletion Tool.
Q. How to change the logical name of a Test Object?
A. When recording an object Quick Test Professional uses one of the object's properties as the logical name for the object (the name displayed in the Expert View and in the Keyward View modes).
You can change the property that is used to be a different one by specifying which property's value you want to use as the logical name for the object.
For example in order to use the alt property as the logical name of an image, run regedit.exe and set the following information:
[HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\Test Objects\Image]"tag query name"="alt"
Q. Changing the Mic.ini file
A. Some of QuickTest Professional information is stored in a text file which is called mic.ini. This file is located under the QuickTest bin directory.
[SectionA]
NameA=ValueA
To enter the above change to the mic.ini file you should perform the following:
1. Open the mic.ini file located under the QuickTest Professional bin directory using any standard text editor
2. Search for section name (in this case 'SectionA'). If it does not exists - add it to the end of the file
3. If the line (beginning with the NameA text) exists in the section, then change the value to be ValueA
If the line does not exist add it to the end of this section (before the next Section begins)




Q. How to change the registry?
A. Note: Errors in the correct editing of the registry may cause severe malfunction to the operating system.
[HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTestProfessional \MicTest\KeyA]
"ValueA"=dword:0000001
"ValueB"="StringValue"
In order to enter the above change to the registry, you should do the following:
1. Open regedit (type regedit in the Start>Run dialog)
2. Navigate to the specified path (in this case navigate to HKEY_CURRENT_USER > Software >...>KeyA)
3. If the path does not exists, right click on the right pane, choose Key and enter the missing key name
4. If the value does not exists, right click on the right pane, choose DWORD value or String value and enter the missing variable name
Right click on the variable, choose Modify and change the value to the correct one.
Q. How to use Environment variable?
A. Quick test supports using environment variables. Environment variables can be either system variables or user defined variables.
You can define the user defined variables in an external file which will be read by Quick Test when it will be launched.
See the Using Environment Variables section in the Quick Test Professional help.

Q.Does Quick Test have any debugging capabilities?
In order to debug tests you must install the Microsoft Script Debugger. If you did not download and installed it while installing Quick Test, the debugger can be still downloaded from the Microsoft Script Technologies site. After downloading it, double-click on the self-extracting executable and follow the instructions on your screen.
Once the Script Debugger is installed, an arrow points to the current step that is being executed in the Tree View and the Expert View. You can then use the debugger to view local action variables, use the command window, view the objects properties, and more.
More information can be found in the Quick Test User's Guide.
Q. What command-line arguments can I use when launching Quick Test?
A. Please refer to the Quick Test Command Line utility for more information on how to run Quick Test using a command line.


Q.I have a Microsoft Access database that contains data I would like to use in my test. How do I do this?
The powerful 'Expert View' allows you to access databases using ADO and ODBC. Below is a sample test that uses the information contained in the Authors table of a database to search for books written by the author.

Dim MyDBDim MyEngSet MyEng = CreateObject("DAO.DBEngine.35")Dim TdDim rs' Specify the database to useSet MyDB = MyEng.OpenDatabase("BIBLIO.MDB")' Read and use the name of the first 10 authorsSet Td = MyDB.TableDefs("Authors")Set rs = Td.OpenRecordsetrs.MoveFirstFor i = 1 To 10 Browser("Book Club").Page("Search Books").WebEdit("Author Name").Set rs("Author") Browser("Book Club").Page("Search Books").WebButton("Search").ClickNext

Q.How do I add a manual wait step to my test?

A manual wait (think time) can be added to a Quick Test test using the following command:
Call Wait(

No comments: