Documente Academic
Documente Profesional
Documente Cultură
------------------------------
1. How QTP scripts are advantageous when need to re-work the same business scenarios?
A. To record the Quick Test Professional Script on one instance and be able to execute it
on any other instance. The assumption is there are no major GUI changes between the
recorded and the execution instances.
2. How can you make the scripts generic and what architecture needs to be followed?
A. In order to achieve the above objective, we need to plan the Quick Test Professional
script. It should have two parts:
1. Script – that is generic Quick test script.
2. Data – from the parameter file that is customer instance specific.
A. Record the Quick Test Professional script and modify it to make it a generic script
using the following steps:
Use Low-Level Recording when you need to record the exact location of the object on
your application screen.
To record in Low-Level Recording, select “Low-Level Recording” from the “Test” menu
while recording
Analog:
Use Analog Recording for applications in which the actual movement of the mouse is
what you want to record.
To record in Analog mode, select “Analog Recording” from the “Test” menu while
recording.
A. The Object Repository dialog box displays a test tree of all objects in the current
action or the entire test (depending on the object repository mode you choose when you
create your test). You can use the Object Repository dialog box to view or modify the
properties of any test object in the repository or to add new objects to your repository.
A. Active screen captures all the properties of the application and makes available even
when offline/ when you are not connected to the application.
The main advantage is checkpoints can be added without connecting to the application
9. What are different Screen capture options available for Active screen?
Minimum—Captures properties only for the recorded object and its parent in the Active
Screen of each step. This level saves the original source HTML of all Web pages (prior to
dynamic changes) and saves Active Screen files in a compressed format.
None—Disables capturing of Active Screen files for all applications and Web pages.
10. How QTP identifies the objects in the application during runtime?
A. QTP uses different properties to identify the objects in the applications. They are:
a. Mandatory Properties
b. Assistive Properties
c. Object Identifies
d. Smart Identification
Smart Identification: QuickTest uses a very similar process of elimination with its Smart
Identification mechanism to identify an object, even when the recorded description is no
longer accurate. Even if the values of your test object properties change, QuickTest’s
TestGuard technology maintains your test’s reusability by identifying the object using
Smart Identification.
Location:
Indicates the order in which the object appears within the parent window, frame, or dialog
box relative to other objects with an otherwise identical description. Values are assigned
from top to bottom, and then left to right.
Creation Time:
Indicates the order in which the browser was opened relative to other open browsers with
an otherwise identical description.
A. Smart Identification:
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.
A. Using the Object Spy, you can view the run-time or test object properties and methods
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. It displays the run-time or
test object properties and values of the selected object in the Properties tab. It displays the
run-time or test object methods associated with the selected object in the Methods tab
You can use the GetROProperty to retrieve the current property value of objects in your
application during the test run.
18.What are User-Defined Test Object Classes. How are they mapped?
When you add a checkpoint, Quick Test adds a checkpoint with an icon in the test tree
and adds a Check Point statement in the Expert View. When you run the test, Quick Test
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 Test Results
window.
A. You can check that a specified object in your application or on your Web page has the
property values you expect, by adding a standard checkpoint to your test. To set the
options for a standard checkpoint, you use the Checkpoint Properties dialog box.
A. Bitmap Checkpoints:
You can check an area of a Web page or application as a bitmap. While creating a test,
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. You can also choose to save only the selected area of
the object with your test in order to save disk space.
A. Accessibility Checkpoints:
You can add accessibility checkpoints to help you quickly identify areas of your Web site
that may not conform to the W3C (World Wide Web Consortium) Web Content
Accessibility Guidelines. You can add automatic accessibility checkpoints to each page in
your test, or you can add individual accessibility checkpoints to individual pages or
frames.
A. XML Checkpoint:
The XML Checkpoint Properties dialog box displays the element hierarchy and values
(character data) of the selected XML file.
Select the element(s), attribute(s), and/or value(s) that you want to check. For each
element you want to check, select the checks you want to perform. For each attribute or
value you want to check, select the checks you want to perform, or the parameterization
options you want to set.
27. What is Synchronization?
A. When you run tests, your application may not always respond with the same speed.
For example, it might take a few seconds:
♣ for a progress bar to reach 100%
♣ for a status message to appear
♣ for a button to become enabled
♣ for a window or pop-up message to open
You can handle these anticipated timing problems by synchronizing your test to ensure
that Quick Test waits until your application is ready before performing a certain step.
A. There are several options that you can use to synchronize your test:
You can insert a synchronization point, which instructs Quick Test to pause the test until
an object property achieves the value you specify. When you insert a synchronization
point into your test, Quick Test generates a WaitProperty statement in the Expert View.
You can insert Exist or Wait statements that instruct QuickTest to wait until an object
exists or to wait a specified amount of time before continuing the test.
Eg. Browser('Yahoo”).Page('CheckMail”).Button(“CheckMail”).Exists(10)
QTP waits for 10 seconds till the button exists in the page. The script proceeds if the
button even exits before 10 seconds unlike wait() statement – it waits for 10 seconds no
matter the button exits before 10 seconds.
33. Well, I would like to run my test with different sets of data, How can I make it with
the options available in QTP?
A. 1. Global Sheet
The Global sheet contains the data that replaces parameters in each iteration of the test.
2. Action Sheets
Each time you add a new action to the test, a new action sheet is added to the Data Table.
Action sheets are automatically labeled with the exact name of the corresponding action.
The data contained in an action sheet is relevant for the corresponding action only.
A. An Quick test script contains different actions. An action contains the script ie. A piece
of business scenario like, login to application, logout etc.
Well again It depends on how you create your framework ( If you would like to know
more about frame work check out this link. Good one. http://www-
128.ibm.com/developerworks/rational/library/591.html) for testing the applications.
I would suggest every action has a piece of business scenario which would help to re-use
the script in a better way. Before deciding what are re-usable scripts. Firstly, identify all
the common scenarios that occur in different business flows across different modules.
Then prepare the scripts and make generic. You can call all these functions by making
this common function library available at Test options > Resourses.
A. Copy of Action:
When you insert a copy of an action into a test, the action is copied in its entirety,
including checkpoints, parameterization, and the corresponding action tab in the Data
Table. If the test you are copying into uses per-action repository mode, the copied
action’s action object repository will also be copied along with the action.
A. Reusable Actions:
Determines whether the action is a reusable action. A reusable action can be called
multiple times within a test and can be called from other tests. Non-reusable actions can
be copied and inserted as independent actions, but cannot be inserted as calls to the
original action.
A. You can insert a call (link) to a reusable action that resides in your current test (local
action), or in any other test (external action).
A. Inserting Transactions:
During the test run, the Start Transaction signals the beginning of♣ the time
measurement. You define the beginning of a transaction in the Start Transaction dialog
box
A. Regular Expressions:
Regular expressions enable QuickTest to identify objects and text strings with varying
values. You can use regular expressions when:
• Defining the property values of an object
• Parameterizing a step
• Creating checkpoints with varying values
A regular expression is a string that specifies a complex search phrase. By using special
characters such as a period (.), asterisk (*), caret (^), and brackets ([ ]), you can define the
conditions of a search. When one of these special characters is preceded by a backslash
(\), QuickTest searches for the literal character.
Here is an example:
The actual pattern for the regular expression search is set using the Pattern property of the
RegExp object. The RegExp.Global property has no effect on the Test method.
The Test method returns True if a pattern match is found; False if no match is found.
The following code illustrates the use of the Test method.
Function RegExpTest(patrn, strng)
Dim regEx, retVal ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = False ' Set case sensitivity.
retVal = regEx.Test(strng) ' Execute the search test.
If retVal Then
RegExpTest = 'One or more matches were found.'
Else
RegExpTest = 'No match was found.'
End If
End Function
MsgBox(RegExpTest('is.', 'IS1 is2 IS3 is4'))
A.
Dim MyVar
MyVar = MsgBox ('Hello World!', 65, 'MsgBox Example')
' MyVar contains either 1 or 2, depending on which button is clicked.
11 Division by zero
432 File name or class name not found during Automation operation
51 Internal error
7 Out of Memory
6 Overflow
13 Type mismatch