Professional Documents
Culture Documents
QTP Faq S
QTP Faq S
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:
4. What is the testing process in QTP? A. The testing process consists of 3 main phases:
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.
9. What are different Screen capture options available for Active screen?
A. Complete—Captures all properties of all objects in the application’s active window/dialog box/Web
page in the Active Screen of each step. This level saves Web pages after any dynamic changes and saves
Active Screen files in a compressed format.
Partial—(Default). Captures all properties of all objects in the application’s active window/dialog
box/Web page in the Active Screen of the first step performed in an application’s window, plus all
properties of the recorded object in subsequent steps in the same window. This level saves Web pages
after any dynamic changes and saves Active Screen files in a compressed format.
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?
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.
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?
A. A checkpoint is a verification point that compares a current value for a specified property with the
expected value for that property. This enables you to identify whether your Web site or application is
functioning correctly.
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.
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 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.
A. You can supply the list of possible values for a parameter by creating a Data Table parameter. 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, Quick Test substitutes the constant value with a different
value from the Data Table.
32. What are Method Arguments? A. Using Method arguments you parameterize method arguments in
the Method Arguments dialog box. to open the Method Arguments dialog box, right-click a step
containing a method in the test tree and choose Method Arguments. The Method Arguments dialog box
opens and displays the method arguments in the step.
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. Listed are the different Data Table Iterations
Run one iteration only:
Runs the test only once, using only the first row in the global Data Table.
Run on all rows:
Runs the test with iterations using all rows in the global Data Table.
Run from row __ to row __ :
Runs the test with iterations using the values in the global Data Table for the specified row range.
34. What are different data tables available?
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.
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.
38. what about Call of 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).
♣ 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
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
#411,AnnapurnaBlock, AdithyaEnclave, Ameerpet, Hyderabad. 7
Ph:040-64510222 E-Mail:
platinum_hyd@yahoo.com
Platinum Technologies Testing Tools
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
Recovery scenario gives you an option to take some action for recovering from a fatal error in the test.
The error could range in from
occasional to typical errors. Occasional error would be like "Out of paper" popup error while printing
something and typical errors would be like
"object is disabled" or "object not found". A test case have more then one scenario associated with it and
also have the priority or order in which it
should be checked.
#411,AnnapurnaBlock, AdithyaEnclave, Ameerpet, Hyderabad. 9
Ph:040-64510222 E-Mail:
platinum_hyd@yahoo.com
Platinum Technologies Testing Tools
43. What does a Recovery Scenario consists of?
Trigger: Trigger is nothing but the cause for initiating the recovery scenario. It could be any popup
window, any test error, particular state
recovery function defined in library file or restart windows. You can have a series of all the specified
actions.
Post-recovery operation: Basically defined what need to be done after the recovery action has been taken.
It could be to repeat the step, move
44. When to use a Recovery Scenario and when to us on error resume next?
Recovery scenarios are used when you cannot predict at what step the error can occur or when you know
that error won't occur in your
QTP script but could occur in the world outside QTP, again the example would be "out of paper", as this
error is caused by printer device driver. "On
error resume next" should be used when you know if an error is expected and dont want to raise it, you
may want to have different actions depending upon the error that occurred. Use err.number &
err.description to get more details about the error.
Library files are files containing normal VBScript code. The file can contain function, sub procedure,
classes etc.... You can also use executefile
function to include a file at run-time also. To associate a library file with your script go to Test-
>Settings... and add your library file to resources
tab.
45. When to associate a library file with a test and when to use execute file?
When we associate a library file with the test, then all the functions within that library are available to all
the actions present in the test. But
when we use Executefile function to load a library file, then the function are available in the action that
called executefile. By associated a library to
a test we share variables across action (global variables basically), using association also makes it
possible to execute code as soon as the script
runs because while loading the script on startup QTP executes all the code on the global scope. We can
use executefile in a library file associated
with the test to load dynamic files and they will be available to all the actions in the test.
Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to
which a test object maps.
Can i change properties of a test object
Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch
off the Smart Identification for the
No (but Yes also). You can use GetROProperty("outerText") to get the outerText of a object but there is
no function like SetROProperty to
change this property. But you can use WebElement().object.outerText="Something" to change the
property.
Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting.
Action can have a object repository
associated with it while a function can't. A function is just lines of code with some/none parameters and a
single return value while an action can
Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action
only. If the functionality is not about any
automation script i.e. a function like getting a string between to specific characters, now this is something
not specific to QTP and can be done on
pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be
put into an function using DP. Decision of
using function/action depends on what any one would be comfortable using in a given situation.
Checkpoint is basically a point in the test which validates for truthfulness of a specific things in the AUT.
There are different types of
checkpoints depending on the type of data that needs to be tested in the AUT. It can be text,
image/bitmap, attributes, XML etc....
What's the difference between a checkpoint and output value?
Checkpoint only checks for the specific attribute of an object in AUT while Output value can output
those attributes value to a column in data
#411,AnnapurnaBlock, AdithyaEnclave, Ameerpet, Hyderabad. 11
Ph:040-64510222 E-Mail:
platinum_hyd@yahoo.com
Platinum Technologies Testing Tools
table.
How can i check if a checkpoint passes or not?
code:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
My test fails due to checkpoint failing, Can i validate a checkpoint without my test failing due to
checpoint failure?
code:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Environment
How can i import environment from a file on disk
Environment.LoadFromFile "C:\Env.xml"
How can i check if a environment variable exist or not?
When we use Environment("Param1").value then QTP expects the environment variable to be already
defined. But when we use
Environment.value("Param1") then QTP will create a new internal environment variable if it does not
exists already. So to be sure that variable exist
*** ads.php
eISN Home <http://eisn.net> Home <index.php> Manual Testing Basics <manual-testing-
basics.php> Procedure <manual-testing-procedure.php> Sample Test Case <stc.doc>
Books On Manual Testing <manual-testing-books.php> FAQ 1 <faq1.php> FAQ 2
<faq2.php> Jobs in Manual Testing <manual-testing-jobs.php> Automation Testing
Basics <automation-testing-basics.php> Books On Automation Testing <automation-
testing-books.php> Jobs In Automation Testing <automation-testing-jobs.php> Testing
Tools & Softwares Load and Performance Test Tools <load-performance-tools.php> Java
Test Tools <java-test-tools.php> Link Checkers <link-checking-tools.php> HTML
Validators <html-validators.php> Free On-the-Web HTML Validators and Link
Checkers <free-html-validators.php> PERL and C Programs for Validating and
Checking <perl-testing-tools.php> Web Functional/Regression Test Tools <web-
functional-tools.php> Web Site Security Test Tools <web-security-tools.php> External
Site Monitoring Services <external-monitoring-tools.php> Web Site Management Tools
<web-management-tools.php> Log Analysis Tools <log-analysis-tools.php> Other Web
Test Tools <other-web -test-tools.php> Interview Questions Test Automation <test-
automation.php> Load Testing <load-testing.php> Win Runner <win-runner.php> Test
Director <test-director.php> QTP <qtp.php> Load Runner <load-runner.php>
DataBase Testing <database-testing.php> Bug Tracking <bug-tracking.php> WhiteBox
Testing <white-box-test.php> Product Testing <product-testing.php> Testing Scenarios
<testing-scenario.php> Wireless Testing <wire-less-testing.php> Web Testing <web-
testing.php> Test Cases <test-cases.php> General Topics Interview Guidelines
<interview-gl.php> Certifications <testing-certifications.php> White Box Testing
<whitebox-testing.php> Black Box Testing <blackbox-testing.php> Unit Testing <unit-
testing.php> Integration Testing <integration-test.php> Performance Testing
<performance-testing.php> Stress Testing <stress-test.php> Security Testing <security-
test.php> Installation Testing <installation-test.php> Usability Testing <usability-
test.php> Stability Testing <stability-test.php> Acceptance Testing <acceptance-
test.php> Alpha Testing <alpha-test.php> Compatibility Testing <compatibility-
test.php> Product Testing <product-test.php> System Testing <system-test.php>
Sample Test Cycle <testing-cycle.php> Test Cases, Suits, Scripts <test-case-ss.php>
Defect Tracking <defect-tracking.php> Formal Verification <formal-verify.php> Fuzz
Testing <fuzz-test.php> Quality Assurance <qa.php>