Saturday, December 10, 2011

For...Each Statement in HP QTP

For...Each Statement
A For...Each loop instructs QuickTest to perform one or more statements for each element in an array or an object collection. It has the following syntax:

For Each item In array
    statement
Next

Item  Description
item  A variable representing the element in the array. 
array  The name of the array. 

statement  A statement, or series of statements, to be performed during the loop. 
The following example uses a For...Each loop to display each of the values in an array:

MyArray = Array("one","two","three","four","five")
For Each element In MyArray
    msgbox element
Next


Note: During a run session, if a For Each statement iterates on the Parameter Definitions collection, the run may fail if the collection was retrieved directly before using the For Each statement. To prevent this, use other VBScript loop statements, such as For or While.

Do...Loop Statement in VB Script

Do...Loop Statement
The Do...Loop statement instructs QuickTest to perform a statement or series of statements while a condition is true or until a condition becomes true. It has the following syntax:

Do [{while} {until} condition]
    statement
Loop


Item           Description  
Condition     A condition to be fulfilled.  
Statement     A statement or series of statements to be performed during the loop. 

In the following example, QuickTest calculates the factorial value of the number of passengers using the Do...Loop:

passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").GetROProperty("value")
total = 1
i = 1
Do while i <= passengers
     total = total * i
     i = i + 1
Loop
MsgBox "!" & passengers & "=" & total  

Variables in VBScript

Variables in VBScript

You can specify variables to store test objects or simple values in your test or function library. When using a variable for a test object, you can use the variable instead of the entire object hierarchy in other statements. Using variables in this way makes your statements easier to read and to maintain.
To specify a variable to store an object, use the Set statement, with the following syntax:
Set ObjectVar = ObjectHierarchy
In the example below, the Set statement specifies the variable UserEditBox to store the full Browser.Page.WebEdit object hierarchy for the username edit box. The Set method then enters the value John into the username edit box, using the UserEditBox variable:
Set UserEditBox = Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username")
UserEditBox.Set "John"
Note: Do not use the Set statement to specify a variable containing a simple value (such as a string or a number). The example below shows how to define a variable for a simple value:

MyVar = Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username").GetTOProperty("type")
You can also use the Dim statement to declare variables of other types, including strings, integers, and arrays. This statement is not mandatory, but you can use it to improve the structure of your test or function library. In the following example, the Dim statement is used to declare the passengers variable, which can then be used in different statements within the current action or function library:
Dim passengers
passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numpassengers").GetROProperty("value")

How to Opening and Closing Applications Programmatically in QTP

Opening and Closing Applications Programmatically
In addition to using the Record and Run Settings dialog box to instruct QuickTest to open a new application when a test run begins, or manually opening the application you want to test, you can insert statements into your test that open and close the applications you want to test.

You can run any application from a specified location using a SystemUtil.Run statement. This is especially useful if your test includes more than one application, and you selected the Record and run test on any application check box in the Record and Run Settings dialog box. You can specify an application and pass any supported parameters, or you can specify a file name and the associated application starts with the specified file open.

You can close most applications using the Close method. You can also use SystemUtil statements to close applications.

For example, you could use the following statements to open a file named type.txt in the default text application (Notepad), type happy days, save the file using shortcut keys, and then close the application:

SystemUtil.Run "C:\type.txt", "","",""
Window("Text:=type.txt - Notepad").Type "happy days"
Window("Text:=type.txt - Notepad").Type micAltDwn & "F" & micAltUp
Window("Text:=type.txt - Notepad").Type micLShiftDwn & "S" & micLShiftUp
Window("Text:=type.txt - Notepad").Close


Note:

When you specify an application to open using the Record and Run Settings dialog box, QuickTest does not add a SystemUtil.Run statement to your test.
The InvokeApplication method can open only executable files and is used primarily for backward compatibility.

Expert View and Keyword View - A Comparison

If you prefer to work with VBScript statements, you can choose to work with your tests in the Expert View, as an alternative to using the Keyword View. You can move between the two views as you wish, by selecting the Expert View or Keyword View tab at the bottom of the Test pane in the QuickTest window.

The Expert View displays the same steps and objects as the Keyword View, but in a different format:

In the Keyword View, QuickTest displays information about each step and shows the object hierarchy in an icon-based table. For more information, see Keyword View.
In the Expert View, QuickTest displays each step as a VBScript line or statement. In object-based steps, the VBScript statement defines the object hierarchy.

The following diagram shows how the same object hierarchy is displayed in the Expert View and in the Keyword View:

The Expert View and Function Library Windows Overview in HP QTP 11

In QuickTest, tests are composed of statements coded in the Microsoft VBScript programming language. The Expert View provides an alternative to the Keyword View for testers who are familiar with VBScript. You can also create function libraries in QuickTest using VBScript.

This section explains how to work in the Expert View, provides a brief introduction to VBScript, and shows you how to enhance your tests and function libraries using a few simple programming techniques.

In the Expert View, you can view an action in VBScript. If you are familiar with VBScript, you can add and update statements and enhance your tests and function libraries with programming. This enables you to increase a test's power and flexibility. You can also create and work with function libraries using the Function Library window.

To learn about working with VBScript, you can view the VBScript documentation directly from the QuickTest Help menu (Help > QuickTest Professional Help > VBScript Reference).

You can add statements that perform operations on objects or retrieve information from your application. For example, you can add a step that checks that an object exists, or you can retrieve the return value of an operation.

You can add steps to your test or function library either manually or using the Step Generator.

Saturday, December 3, 2011

Understanding Absolute and Relative Paths in QTP 11.5

Understanding Absolute and Relative Paths

You can save QuickTest resources, such as shared object repositories, function libraries, recovery scenarios or environments, using absolute or relative paths.

Absolute Paths
An absolute path describes the full path to a specific file starting from a fixed location such as the root directory, or the drive on which the file is located, and contains all the other sub-directories in the path. An absolute path always points to the specified file, regardless of the current directory.
If you are working with the Resources and Dependencies model with Quality Center 10.00 or HP ALM, you must specify an absolute Quality Center path to enable your tests to access your resource files.

Relative Paths
A relative path describes the path to a specific file starting from a given directory, and is generally only a portion of the absolute path. A relative path therefore specifies the location of the file relative to the given location in the file system.
Using relative paths means that the paths remain valid when files or folders containing files are moved or copied to other locations or computers, provided that they are moved within the same folder structure. If you are not working with the Resources and Dependencies model with Quality Center 10.00 or HP ALM, we recommend that you use relative paths when saving resources in QuickTest.

Example 


Consider a QuickTest resource file named FunctionLibrary1.qfl located in C:\Current_Version\Libraries. The absolute path to the file is
C:\Current_Version\Libraries\FunctionLibrary1.qfl. 
The relative path to the file from within the folder named Libraries is specified using only the name of the file, FunctionLibrary1.qfl. Alternatively, the relative path to the file from within another folder, such as C:\Current_Version\Libraries\MyFiles, would be Libraries\FunctionLibrary1.qfl.

Using a relative path, you could copy the FunctionLibrary1.qfl file from C:\Current_Version\Libraries to an updated version in C:\New_Version\Libraries, and the path used by QuickTest would remain valid.


Checkpoint Types in QTP 11.5

You can insert the following checkpoint types to check objects in an application:

Standard Checkpoint     Checks property values of an object in your application. For example, you can check that a radio button is activated after it is selected or you can check the value of an edit box.
Standard checkpoints are supported for all add-in environments   .

Image Checkpoint     Checks the value of an image in your application. For example, you can check that a selected image's source file is correct.
You create an image checkpoint by inserting a standard checkpoint on an image object.
Image checkpoints are supported for the Web add-in environment   .

Bitmap Checkpoint  
   Checks an area of your application as a bitmap. 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. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create a bitmap checkpoint for any area in your application.
Bitmap checkpoints are supported for all add-in environments   .

Table Checkpoint     Checks information within a table. For example, suppose your application contains a table listing all available flights from New York to San Francisco. You can add a table checkpoint to check that the time of the first flight in the table is correct.
You create a table checkpoint by inserting a standard checkpoint on a table object. For more information on table checkpoints.

Table checkpoints are supported for all add-in environments that have a *Table test object. Table checkpoints are also supported for some list view objects, such as WinListView and VbListView, as well as other list view objects in add-in environments. For more information,

Text Checkpoint     Checks that a text string is displayed in the appropriate place in an application. For example, suppose a Web page displays the sentence Flight departing from New York to San Francisco. You can create a text checkpoint that checks that the words "New York" are displayed between "Flight departing from" and "to San Francisco".

Text checkpoints are supported for most add-in environments   .

Text Area Checkpoint     Checks that a text string is displayed within a defined area in a Windows-based application, according to specified criteria. For example, suppose your Visual Basic application has a button that says View Doc <Num>, where <Num> is replaced by the four digit code entered in a form elsewhere in the application. You can create a text area checkpoint to confirm that the number displayed on the button is the same as the number entered in the form.

Text area checkpoints are supported for all Windows-based environments, such as Standard Windows, Visual Basic, and ActiveX add-in environments   . Text area checkpoints are also supported for some other add-in environments, such as Java.

Accessibility Checkpoint     Identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines. For example, guideline 1.1 of the W3C Web Content Accessibility Guidelines requires you to provide a text equivalent for every non-text element. You can add an Alt property check to check whether objects that require the Alt property under this guideline, do in fact have this tag.
Accessibility checkpoints are supported for the Web add-in environment   .

Page Checkpoint     Checks the characteristics of a Web page. For example, you can check how long a Web page takes to load or whether a Web page contains broken links.
You create a page checkpoint by inserting a standard checkpoint on a page object.
Page checkpoints are supported for the Web add-in environment   .

Database Checkpoint     Checks the contents of a database accessed by your application. For example, you can use a database checkpoint to check the contents of a database containing flight information for your Web site.

Database checkpoints are supported for all add-in environments   .

XML Checkpoint     Checks the data content of XML documents in XML files or XML documents in Web pages and frames. For more information on XML checkpoints, The XML Checkpoint (Web Page/Frame) option is supported for the Web add-in environment. The XML Checkpoint option is supported for all add-in environments  

How to Add checkpoints in your tests

QuickTest enables you to reuse existing checkpoints. When you create checkpoints, consider which checkpoints can be reused in multiple locations in your test or in multiple tests. For example:

Checkpoints that check generic content or the state of your application may be useful in multiple locations.
Checkpoints that check the content of a specific area of your application are generally useful in only one particular place in your test.
The following examples illustrate situations in which inserting an existing checkpoint may be useful:

If each page of your application contains your organization's logo, you can reuse a bitmap checkpoint to verify each occurrence in the application.
If your application contains multiple edit boxes, you can reuse a checkpoint to confirm the enabled status of these edit boxes throughout your test.

What is Checkpoints in QTP

Checkpoints Overview

QuickTest enables you to add checks to your test. A checkpoint is a verification that compares the current value for specified properties or current state of other characteristics of an object with the expected value or characteristics. This helps you to identify whether your application is functioning correctly.
When you add a checkpoint, QuickTest inserts a checkpoint step to the current row in the Keyword View and adds a Check CheckPoint statement in the Expert View. By default, QuickTest names the checkpoint using the name of the test object on which the checkpoint was created. You can choose to specify a different name for the checkpoint or accept the default name.
When you run the test, QuickTest compares the expected results of the checkpoint to the current results. If the results do not match, the checkpoint fails. You can view the results of the checkpoint in the Run Results Viewer.

Creating Tests Using the Keyword-Driven Methodology

Creating Tests Using the Keyword-Driven Methodology
This methodology requires an infrastructure for all of the required resources. Resources include shared object repositories, function libraries, and recovery scenarios. Setting up the infrastructure requires in-depth knowledge of your application and a high level of QuickTest expertise.

Although setting up the infrastructure may initially require a longer time-investment in comparison to recording tests, using the keyword-driven methodology enables you to create tests at a more application-specific level and with a more structured design. This enables you to maintain your tests more efficiently and provides you with more flexibility than a recorded test.

When to Use Keyword-Driven Testing 

Keyword-driven testing enables you to design your tests at a business level rather than at the object level. For example, QuickTest may recognize a single option selection in your application as several steps: a click on a button object, a mouse operation on a list object, and then a keyboard operation on a list sub-item. You can create an appropriately-named function to represent all of these lower-level operations in a single, business-level keyword.
By incorporating technical operations, such as a synchronization statement that waits for client-server communications to finish, into higher level keywords, tests are easier to read and easier for less technical application testers to maintain when the application changes.
Keyword-driven testing naturally leads to a more efficient separation between resource maintenance and test maintenance. This enables the automation experts to focus on maintaining objects and functions while application testers focus on maintaining the test structure and design.
When you record tests, you may not notice that new objects are being added to the local object repository. This may result in many testers maintaining local object repositories with copies of the same objects. When using a keyword-driven methodology, you select the objects for your steps from the existing object repository. When you need a new object, you can add it to your local object repository temporarily, but you are also aware that you need to add it to the shared object repository for future use.
When you record a test, QuickTest enters the correct objects, methods, and argument values for you. Therefore, it is possible to create a test with little preparation or planning. Although this makes it easier to create tests quickly, such tests are harder to maintain when the application changes and often require re-recording large parts of the test.
When you use a keyword-driven methodology, you select from existing objects and operation keywords. Therefore, you must be familiar with both the object repositories and the function libraries that are available. You must also have a good idea of what you want your test to look like before you begin inserting steps. This usually results in well-planned and better-structured tests, which also results in easier long-term maintenance.

Automation experts can add objects and functions based on detailed product specifications even before a feature has been added to a product. Using keyword-driven testing, you can begin to develop tests for a new product or feature earlier in the development cycle.


How to export data from database table to Excel sheet and Datatable

How to export data from database table to Excel sheet and Datatable

‘  Adding NewDataSheet in Run Time
DataTable.AddSheet “MySheet”

‘ ‘  Adding Column name in Run time
DataTable.GetSheet(“MySheet”).AddParameter “bname”,” “
‘ Create DataBase Connection
Set objCon = CreateObject(“ADODB.Connection”)
objCon.Open”Provider=SqlOledb.1;Server=sys;uid=sa;pwd=;database=db1″
‘ (OR)  Open DataBase Connection

objCon.Open”Provider=Microsoft.Jet.Oledb.4.0;Data Source=D:\NewDB.mdb”

‘  Creating Record set for DataSet
Set objRs=CreateObject(“adodb.recordset”)

‘ Opening RecodSet form DataBase( storing the values in recordsetb )
objRs.open”select * from Emp”,objCon

‘ Loop for Getting DataBase Column name
For intCount = 1 to objRs.Fields.Count-1
i = 1

‘ column name in run time data sheet using add parameter method
DataTable.GetSheet(“MySheet”).AddParameter objRs.Fields(intCount).Name,” “
‘ Loop for Checking end of the Recod
While objRs.eof<>true
‘  Seting the current row
DataTable.SetCurrentRow(i)
‘   inc’ents for data table row
i=i+1
‘  Assigning the DataBase Values into DataTable
DataTable.Value(objRs.Fields(intCount).Name,”MySheet”) = objRs.Fields(intCount).Value
‘’ ——->  moving the record  pointed to next record
objRs.MoveNext
Wend
‘  moving the record  pointed to First record
objRs.MoveFirst
Next
‘ Exporting the results in local
DataTable.ExportSheet”D:\HPQTPForum.xls”,3

Friday, November 25, 2011

HP QTP 11.5 Testing Process

Testing Process
The QuickTest testing process consists of the following main phases:
 1 Analyzing your application
The first step in planning your test is to analyze your application to determine your testing needs.
➤ What are your application’s development environments (for example Web, Java, or .NET)? You will need load QuickTest add-ins for these environments to enable QuickTest to identify and work with the objects in your application.
➤ What business processes and functionality do you want to test? To answer this, think about the various activities that customers perform in your application to accomplish specific tasks.
➤ Consider how to divide these business processes into smaller units.You will be creating actions based on these tasks. Smaller and more modular actions make your tests easier to read and follow, and help
ease maintenance in the long run.
At this stage, you can already begin creating test skeletons and adding actions to them.

 2 Preparing the testing infrastructure
Based on your testing needs, you determine what resources are required and create these resources, accordingly. Resources include shared object repositories containing test objects (which are representations of the objects in your application), function libraries containing functions that
enhance QuickTest functionality, and so on.You also need to configure QuickTest settings so that QuickTest will perform the tasks you need, such as displaying a results report every time
you run a test.

3 Building your tests and adding steps to them
After the testing infrastructure is ready, you can begin building your tests. You can create one or more empty tests and add actions to them to create the testing skeletons. You associate your object repositories with the
relevant actions, and associate your function libraries with the relevant tests, so that you can insert steps using keywords. You may also need to
configure test preferences at this point.

 4 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 determine whether your
application is functioning correctly.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 or loop statements enables you to add sophisticated checks to your test.

 5 Debugging, running, and analyzing your test
You debug a test to ensure that it operates smoothly and without interruption. After the test is working correctly, you run it to check the behavior of your application. While running, QuickTest opens the
application and performs each step in your test.You examine the run results to pinpoint defects in your application.

 6 Reporting defects
If you have QualityCenter installed, you can report the defects you
discover to a database. QualityCenter is the HP test management
solution

HP Brings New Certification Exams for QTP 11.0 & QC 11.0 from July 2011

HP Brings New Certification Exams for QTP 11.0 & QC 11.0 from July 2011:-HP has phased out the AIS - HP Quality Center v10 certification from 01 July 2011. Let us see a quick comparison as to what was the situation earlier versus what is now.

Sr.
 What was Earlier?
What is available Now?
1.
AIS - HP Quality Center certification used to be awarded after clearing two exams like
1) QTP 10.0
&
2) QC 10.0
HP AIS certification is now being awarded upon clearing just a single exam either focussing on 1) QTP 11.0
or
2) Quality Center 11.0.
2.
HP QuickTest Professional 10.0 Software (Exam Code: HP0-M39)
HP Functional Testing 11.x software (Exam Code: HP0-M47)

Short name - FTv11
3.
HP Quality Center 10.0 Software (Exam Code: HP0-M31)
HP Application Lifecycle Management 11.x Software (Exam Code: HP0-M46)

Short name - ALM v11
4.
Certification exams had been active till 31st July 2011
Certification exams are active from 15th May 2011
Summary of New Certifications:-HP AIS (Accredited Integration Specialist) certification is now being awarded upon clearing just a single exam focussing either on QTP 11.0 or Quality Center 11.0.
For getting AIS HP certifications, following two independent paths are available now.
1) For aspirants willing to get certification focussing on QTP 11.0 – the available exam is HPO-M47 (Functional Testing 11.x software).2) For aspirants willing to get certification focussing on QC 11.0 – the available exam is HPO-M46 (HP Application Lifecycle Management 11.x Software).
A) Highlights of New QTP 11.0 Exam: New exam HP0-M47 replaces old HP QuickTest Professional 10.0 exam HP0-M39.
a) The new certification is now being called HP AIS – Functional Testing v11
b) Exam details:
# Number of Questions: 72
# Type of Question: multiple choice, drag-and-drop, and point and click
# Exam time: 105 minutes
# Passing score: 75%
The following testing objectives represent the specific areas of content covered in the exam.
The exam HPO-M47 measures the candidates understanding of these areas.
Coverage %
 Sections / Objectives
10%
Automated test planning

# Plan for general testing and automation.
# Plan for QTP testing.
# Identify and describe features and settings.
# Explain QTP licensing and packaging.
19%
Basic test creation and how QTP works with objects
# Create the basic test.
# Explain how QTP works with objects.
# Add steps without recording.
# Explain the purpose and operation of Smart Identification feature.
24%
Basic test verification and enhancement

# Add standard and custom verification points.
# Enhance tests with parameters.
# Add custom checkpoints.
# Add database checkpoints.
# Add bitmap checkpoints.
# View test results.
11%
Modular automated test builds

# Explain how to build modular QTP tests with Actions.
# I Use a Shared Object Repository.
7%
QTP and ALM integration

# Explain the QTP/ALM connection.
# Define ALM management of QTP resources.
# Explain versioning features in QTP
10%
Automated test troubleshooting

# Troubleshoot Object Recognition problems.
# Use Recovery scenarios.
# Use the Debugging Tool.
# Measure System Performance.
# Configure log tracking.
4%
Advanced QTP Scripting

# Import and export Excel sheets.
# Get and set object properties.
# Identify descriptive programming to bypass repository.
7%
Expert View

# Describe Expert View features.
# Describe dynamic object programming.
# Identify and describe VBScript elements.
8%
Web applications

# Recognize Web Add-in Extensibility.
# Describe Web event recording use and configuration.
# Identify new web testing capabilities.
New Features of QuickTest Professional

# Visual Relation Identification
# Log Tracking
# Improved Regular Expressions
# New Results Viewer
# GUI and GUI-Less Testing
# Loading Function Libraries at Run-Time

HPO-M47 50 QTP 11.X Certification Questions and Answers

50 QTP Certification Questions and Answers

1. The Toolbar enables you to view the details of an individual Action or the entire Test flow is
1. Testing toolbar
2. None of the above
3. Action toolbar
4. Test Pane


ANSWERE: 3
2. The key that is used to Start/End analog Recording mode ?
1. F3
2. SHIFT+ALT+F3
3. CTRL+SHIFT+F3
4. F10
ANSWERE: 2

3.QuickTest supports virtual object for anolog or low-level recording.
1. False
2. True
ANSWERE: 1

4. To use a specific property to identify your object, but that property is not listed in the properties list. Then how do you identify that object?
1. Add the specific property to the list
2. Use the Default property
3. Use some other property to identify your object
ANSWERE: 1

5. The CHECKPOINT used to check the alt attribute exists for all relevant Objects (such as images) is
1. DataBase CheckPoint
2. Accessibility checkpoint
3. Bitmap checkpoint
4. STANDARD checkpoint
ANSWERE: 2

6. Bitmap checkpoint is supported in VB environment.
1. True
2. False
ANSWERE: 1

7.Can we parameterize the Checkpoints properties?
1. No
2. Yes
ANSWERE: 2

8. What is the shortcut key that is used for a Standard Checkpoint?
1. F12
2. F2
3. F10
4. F7
ANSWERE: 1

9.Can we change name of checkpoint?
1. No
2. Yes
ANSWERE: 1

10. To compares the values of the specified property during a run session with the values stored for the same test object property within the test.
1. Checkpoint
2. All the above
3. Output Value
4. Compare the object property
ANSWERE: 1

11. You will use the recording mode for an object not recognized by QuickTest.
1. Low-Level Recording Mode
2. Normal recording Mode
3. Analog Mode
ANSWERE: 1

12. The statement that calls the recorded analog file is
1. RunAnalog
2. CallAnalog
3. ExecuteAnalog
ANSWERE: 1

13. An action can be called by other tests or Actions is
1. Call Action
2. Split Action
3. Reusable action
ANSWERE: 3

14. You can replace the page in your Active Screen tab
1. False
2. True
ANSWERE: 2

15. QuickTest adds a checkpoint statement in the Expert View as
1. Check Checkpoint
2. Checkpoint
ANSWERE: 1

16.A Checkpoint checks that a text string is displayed within a defined area in a Windows application is
1. Accessibility
2. Text Area
3. Standard
4. Text
ANSWERE: 2

17. In ActiveX environment an â€Å“Accessibility checkpoint” is supported.
1. No
2. Yes
ANSWERE: 1

18. Can we get the execution time for an action in a Test.
1. Yes
2. No
ANSWERE: 1

19. Can we add external library files in QTP?
1. No
2. Yes
ANSWERE: 2

20. The method used to get data from HTML Table is
1. GetData(Row,Col)
2. GetRowValue(Rowid,Colname)
3. GetCellData (Row,Col)
ANSWERE: 3

21.The Command used to insert the transactions in test is,
1. StartTransaction(â€Å“Name”), EndTransaction(â€Å“Name”)
2. Services.StartTransaction “Name”, Services.EndTransaction “Name”
3. StartTransaction.services “Name”, EndTransaction.services “Name”
ANSWERE: 2

22. A step in which one or more values are captured at a specific point in your test and stored for the duration of the run session is
1. Output Value
2. Checkpoints
3. Active Screen
ANSWERE: 1

23. QuickTest can detects an Application crash and activate a defined recovery scenario to continue the run session.
1. True
2. false
ANSWERE: 1

24. In Batch Test process, the test list are saved in file format as,
1. *.mtb
2. *.mts
3. *.mbt
4. *.mtr
ANSWERE: 1

25.The command used to invoke other application from QTP,
1. InvokeApplication
2. SystemUtil.Run
3. Run
4. Both b & c
5. Both a & b
ANSWERE: 5

26.The command used to retrieve data from excel sheet is
1. Set ab = Connection(”srcfilepath “) , Set ws = ab.getdata(sheetid)
2. Set ab = CreateObject(”srcfilepath “) , Set ws = ab.getsheet(sheetid)
3. Set ab = GetObject(”srcfilepath”) , Set ws = ab.worksheets(sheetid)
ANSWERE: 2

27. The method that explicitly activates the recovery scenario mechanism is,
1. recovery.activate
2. enable
3. recovery.enable
4. activate
ANSWERE: 1

28. The method used for sending information to the test Results.
1. Reporter.log()
2. Reporter.REPORTEVENT()
3. Reporter.MsgBox()
4. Reporter.Report()
ANSWERE: 2

29.To terminate an application that is not responding we use,
1. SystemUtil.terminate
2. SystemUtil.Stop
3. SystemUtil.CloseProcessByName
ANSWERE: 3

30.The recovery mechanism does not handle triggers that occur in the last step of a test
1. false
2. True
ANSWERE: 2

31. We can add Test object methods, function calls into the Test using
1. Function generator
2. Step Generator
3. Object Repository
ANSWERE: 1

32. The method that adds to the test while implementing Synchronization is
1. Synchronize
2. Wait
3. WaitProperty
4. Pause
ANSWERE: 3

33. The mechanism used to identify objects during run session is
1. Recovery scenario
2. Smart identification
3. Handling object
ANSWERE: 2

34.Post-recovery test run Options specifies
1. how to continue the run session after QTP identify the event
2. errors while Running
3. recovery scenario during a run session
ANSWERE: 1

35. The action that can be called multiple times by the test as well as by other tests is called
1. Non-Reusable action
2. Reusable action
3. External action
ANSWERE: 2

36. The command used to connect with Database is
1. Createobject(â€Å“connectivity name”)
2. dbconnect(â€Å“connectivity name”)
3. open(â€Å“connectivity name”)
4. None of the above
ANSWERE: 1

37. The method used to retrieve the folders is
1. FileSystemObject.Getfolder()
2. FileSystemObject.selectfolder()
3. FileSystemObject.retrievefolder()
ANSWERE: 1

38. The method used to compare 2 XML files is:
1. XMLfile1.compare(XMLfile2)
2. XMLcompare(file1,file2)
3. compare(XMLfile1,XMLfile2)
ANSWERE: 3

39. The QTP script files are stored in the extension of
1. *.mts
2. *.usr
3. *.mtr
4. *.vbs
ANSWERE: 1

40. The method used to register the user-defined function with test object is
1. setFunc()
2. RegisterUserFunc()
3. RegisterFunc()
ANSWERE: 2

41. The method used to open the specified URL in a browser is
1. openURL()
2. navigateURL()
3. navigate()
ANSWERE: 3

42. The 3 Parameter types available in data Driver is
1. DataTable,Environment,Random number
2. DataTable,random number,unique
3. environment,string,numeric
ANSWERE: 1

43. The method added to the test while Parameterizing is
1. get Data (variable, dtGlobalSheet)
2. get DataTable(variable, dtGlobalSheet)
3. Set Data(variable, dtGlobalSheet)
4. Set DataTable(variable, dtGlobalSheet)
ANSWERE: 4

44. The length of the array can be get by the method
1. length(array)
2. ubound(array)
3. count(array)
ANSWERE: 2

45. The method used to get the count value of list box or combo box os
1. GetItemsCount
2. GetCount
3. GetItemCount
ANSWERE: 1

46. To retrieve the current property value of the objects in your application during the run session.
1. GetVisibleText
2. GetROProperty
3. SetROProperty
4. GetTOProperty
ANSWERE: 2

47. In data base check point we can not set the expected value from the test?
1. True
2. False
ANSWERE: 2
48. The list of test objects and their properties and values are stored in the
1. Object Repository
2. Object Identification
ANSWERE: 1

49. The method used to continue the test execution after getting run-time error is
1. On Error Resume Next
2. On Error Raise Next
3. On Error Next
ANSWERE: 1

50.Object repository file extension is?
1.  .Obj
2.  .Orf
3.  .Tsr
ANSWERE: 3

HP QTP Certification HPO-M47 Practice Exam Questions

Q - 462: Which checkpoint type should you use to validate the enabled state of a button?
A. Text
B. Standard
C. Bitmap
D. XML

Q - 463: Which term is used to define a string of special characters that define the condition of the search?
A. Constant expression
B. Placeholder
C. Regular expression
D. Parameter

Q - 464: You have multiple test cases that require you to test valid and invalid username and password combinations. Which parameter type should you use?
A. Output
B. Input
C. Random Number
D. Environment

Q - 465: Where is data for an Input parameter stored?
A. Run-time Data Table
B. Design-time Data Table
C. Run-time Data Repository
D. Design-time Data Repository

Q - 466: User-defined environment variables can be imported from an external file. What is the valid file type that can be imported?
A. txt
B. xml
C. csv
D. html

Q - 467: After playing back a test containing output values, where can the output values be viewed?
A. Global Data Table
B. Local Data Table
C. Design-time Data Table
D. Run-time Data Table

Q - 468: Which status is reported in the Test Results Summary if the test does not include checkpoints?
A. Fail
B. Passed
C. Done
D. Complete

Q - 469: You ran a test scenario with 10 iterations. What does the Test Results Summary report if 8 iterations pass and 2 iterations fail?
A. The summary reports PASS because more iterations passed than failed.
B. The summary reports the status for each iteration.
C. The summary reports DONE.
D. The summary reports FAIL because all iterations did not pass.

Q - 470: A tester uses QuickTest Professional connected to Quality Center and the tests are stored in Quality Center. At an upcoming conference, this tester wants to demonstrate a new QuickTest Professional test.
The test makes calls to reusable actions from other QuickTest Professional tests stored in Quality Center.
What is the simplest way to make the test portable so it can run disconnected from Quality Center?
A. Use the QuickTest Professional Save test with resources feature.
B. Change the calls to the reusable actions, use copies of the reusable actions, and then use the QuickTest Professional Save test with resources feature.
C. Use the QuickTest Professional Save test with resources feature for main test and do the same for the test that contains the called reusable actions.
D. Use the QuickTest Professional Export to zip feature.

Correct Answers to Earlier Questions - Q.461 to Q 470 are as under:
Question No.    Correct Answer
Q. 461    In Picture
Q. 462    B
Q. 463    C
Q. 464    B
Q. 465    B
Q. 466    B
Q. 467    D
Q. 468    C
Q. 469    B
Q. 470    A

HP QTP Certification HPO-M47 Practice Exam Questions


Q - 471: What happens when a tester performs an Insert > Call to Copy of Action?
A. The local Data Table and the run iterations settings (in action call properties) are copied over.
B. The steps, checkpoints, parameterizations, action parameters, and object repository are all copied over.
C. Only the called action, but none of its child actions (that is, actions called by it), is copied over.
D. The Use data stored with the original action is disabled.

Q - 472: Which feature displays all the test's actions?
A. Actions tree within the Resources panel
B. Test Flow panel
C. Flow Viewer panel
D. Test Action Manager Tool


Q - 473: Where are the local data sheet iterations specified?
A. Test Run Properties
B. Action Settings
C. Action Call Properties
D. Test Flow Settings


Q - 474: When inserting a call to a reusable action, how are the data resources in that action handled?
A. The data continues to be stored with the original action (read-only) and the new action refers to it.
B. A copy of the data is made (editable) and stored with the new action.
C. The tester must make a one-time selection to either copy the data or refer to the original data.
D. The tester always has the option to copy the data or refer to the original data.

Q - 475: Where do you go to modify a shared object repository?
A. Resources > Object Repository Manager
B. Resources > Object Repository
C. Tools > Object Repository Manager
D. Tools > Resources Manager > Object Repository


Q - 476: Which QuickTest Professional tool uses the Object Repositories Merge Tool?
A. Map Repository Parameters Tool
B. Update from Local Repository Tool
C. Object Repository Comparison Tool
D. Update from Application Tool


Q - 477: Which conflicts does the Objects Repositories Merge Tool detect? (Select three.)
A. Same object different parent
B. Same name different description
C. Same description different name
D. Same name extra properties
E. Similar description





Q - 479: Click the Exhibit button.


You are creating a recovery scenario to handle the pop-up shown in the exhibit. Which recovery option should you select?
A. Keyboard or mouse operation
B. Close application process
C. Function call
D. Restart Microsoft Windows

Q - 480: What is the correct syntax for a programmatic description?
A. WebEdit("Name:=Author" , Index:=3)
B. WebEdit("Name:=Author" , "Index:=3")
C. WebEdit("Name:=Author";"Index=3")
D. WebEdit("Name:=Author";"Index:=3)

Correct Answers to Earlier Questions - Q.471 to Q 480 are as under:
Question No.
Correct Answer
Q. 471
B
Q. 472
B
Q. 473
C
Q. 474
D
Q. 475
A
Q. 476
B
Q. 477
B,C,E
Q. 478
In Picture
Q. 479
A
Q. 480
B