What is meant by Step Generator in Qtp How is it used? pls
gimme in detail

Answer Posted / srinivas

When you design tests, you usually begin by adding steps
that represent the operations an end-user would perform as
part of the business process you want to test. Then, to
increase the power and flexibility of your test, you can
add steps that contain programming logic to the basic
framework.

Programming statements can contain:

Test object operations. These are methods and properties
defined by QuickTest. They can be operations that a user
can perform on an object, operations that can retrieve or
set information, or operations that perform operations
triggered by an event.
Native operations. These are methods and properties defined
within the object you are testing, and therefore are
retrieved from the run-time object in the application.
VBScript programming commands that affect the way the test
runs, such as conditions and loops. These are often used to
control the logical flow of a test.
Supplemental statements, such as comments, to make your
test easier to read, and messages that appear in the test
results, to alert you to a specified condition.
This section shows you how to insert different types of
statements, mostly from the Keyword View, aided by the Step
Generator and other dialog boxes.

The Step Generator dialog box helps you add steps that use
test object operations, Utility object operations, and
function calls, so that you do not need to memorize syntax
or to be proficient in high-level VBScript. You can use the
Step Generator from the Keyword View and also from the
Expert View.

For information on how to insert statements in the Expert
View, see Working in the Expert View and Function Library
Windows.

You can incorporate decision-making into your test and
define messages for the test results by using the
appropriate dialog boxes.

In addition, you can improve the readability of your test
using With statements. You can instruct QuickTest to
automatically generate With statements as you record. But
even after your basic test is recorded, you can convert its
statements, in the Expert View, to With statements—by
selecting a menu command.

You can handle synchronization issues between the run
session and your application, using synchronization points.

When working with tests, you can also measure how long it
takes certain parts of your test to run, using transaction
statements.


Inserting Steps Using the Step Generator
The Step Generator enables you to add steps by selecting
from a range of context-sensitive options and entering the
required values. In the Step Generator dialog box you can
define steps that use:

test object operations (tests only)
Utility object operations
calls to library functions (tests only), VBScript
functions, and internal script functions
For example, you can add a step that checks that an object
exists, or that stores the returned value of a method as an
output value or as part of a conditional statement. You can
parameterize any of the values in your step.

Note: You can use the Step Generator to insert steps in
tests and function libraries. However, in function
libraries, you cannot use the Step Generator to access test
object names or collections, or to access the list of
library functions.

Before you open the Step Generator to define a new step,
you first select where in your test the new step should be
inserted. For more information on the hierarchy of steps
and objects, see Understanding the QuickTest Object
Hierarchy.

After you open the Step Generator, you first select the
category for the step operation (test object, Utility
object or function) and the required object or the function
library source (for example, built-in or local script
functions). You can then select the appropriate operation
(method, property, or function) and define the arguments
and return values, parameterizing them if required.

The Step Generator then inserts a step with the correct
syntax into your test. You can continue to add further
steps at the same location without closing the Step
Generator.

You can open the Step Generator from the Keyword View,
Expert View, or Active Screen.

To open the Step Generator from the Keyword View or Expert
View:

While recording or editing, click the step which you want
the new step to follow. (When you finish defining the new
step, QuickTest will insert it after this step.)
Select Insert > Step Generator or right-click the step and
select Insert Step > Step Generator. Alternatively, press
F7.
The Step Generator dialog box opens and displays the object
from the selected step in the Object box. For more
information, see Defining Steps in the Step Generator
Dialog Box.

To open the Step Generator from a function library:

In the function library, click the location in which you
want to insert the new step.
Select Insert > Step Generator, or right-click and select
Step Generator. Alternatively, press F7.
The Step Generator dialog box opens. For more information,
see Defining Steps in the Step Generator Dialog Box.

To open the Step Generator from the Active Screen while
editing:

Confirm that the Active Screen is displayed. If it is not,
select View > Active Screen or toggle the Active Screen
toolbar button .
In the Keyword View or Expert View, click the step which
you want the new step to follow. (When you finish defining
the new step, QuickTest will insert it after this step.)
The Active Screen displays the captured bitmap or HTML
source corresponding to the selected step.
In the Active Screen, right-click the object for which you
want to insert a step, and select Step Generator.
If the location you clicked is associated with more than
one object, the Object Selection - Step Generator dialog
box opens.





Select an object and click OK. The Step Generator dialog
box opens and displays the object from the selected step in
the Object box. For more information, see Defining Steps in
the Step Generator Dialog Box.

Selecting the Object for the Step
The Object Selection - Step Generator dialog box enables
you to select the object for which you want to insert a
step.





The objects are displayed in hierarchical order based on
the location where you clicked in the Active Screen or
application. Selecting an object and clicking OK displays
the Step Generator dialog box for the selected object.


Defining Steps in the Step Generator Dialog Box
The Step Generator dialog box enables you to add steps that
perform operations, using test object methods (for tests
only), Utility object methods, or function calls.





Note: The Step Generator dialog box that opens from the
Expert View and from a function library is similar to the
dialog box that opens from the Keyword View (shown in the
example above).

In the Expert View, the Step Generator contains additional
Utility objects and the box at the bottom of the dialog box
shows a preview of the step that will be inserted in the
Expert View. For more information, see Viewing the
Generated Step in the Expert View.

In a function library, the Step Generator has a different
title, contains only Utility objects and built-in and local
script functions, and the box at the bottom of the dialog
box shows a preview of the statement that will be inserted
in the function library. For more information, see Viewing
the Generated Step in a Function Library.

When the Step Generator dialog box opens, the object from
the selected step is displayed in the Object box and the
default method for the object is shown in the Operation
box.

Defining a New Step
When you define a new step, you first select the type of
step that you want to add to your test. You can then select
the specific object and operation for the step, or the
function that you want the step to use.

After you select the operation for the step, you can
specify the relevant argument values and the location for
the return value, if applicable. These values can be
parameterized if required.

Finally, you can view the step documentation or statement
syntax and add your new step or statement to your test or
function library.

Note: Although the Step Generator shows information
regarding the currently selected step, selections that you
make in the Step Generator add a new step to your test;
they do not modify the existing step.

Selecting the Type of Step to Add
In the Category list box, you can select one of the
following options:

Test Objects. Enables you to select a test object and
operation for the step (for tests only). For more
information, see Specifying a Test Object and Operation for
the Step.
Utility Objects. Enables you to select a Utility object and
operation for the step. For more information, see
Specifying a Utility Object and Operation for the Step.
Functions. Enables you to select a function for the step
from the available library functions (tests only), VBScript
functions, and internal script functions. For more
information, see Specifying a Function for the Step.
Specifying Argument Values
After you select the object and the operation (method,
property, or function) for the step, you can specify the
relevant argument values. These values can be parameterized
if required.

If the selected operation has arguments, the Arguments area
displays the name and type of each argument.

In the Value column, you can define the values for the
arguments, as follows:

Mandatory arguments. If the name of the argument is
followed by a red asterisk (*), you must specify a value
for the argument. You cannot insert the step or view the
step documentation if the values have not been defined for
all mandatory arguments.
Optional arguments. If the name of the argument is not
followed by a red asterisk (*), you can specify a value for
the argument or leave the cell blank. If you do not specify
a value, QuickTest uses the default value for the argument.
(You can view the default value by moving the pointer over
the cell).
Required arguments. If you specify a value for an optional
argument, then you must also specify the values for any
optional arguments that are listed before this argument. If
you do not specify these values, QuickTest uses the default
values for all required arguments. You can see the default
value for each argument in a tooltip, by moving the pointer
over the Value column.
Parameterized arguments. You can use a parameter for any
argument value by clicking the parameterization button .
For more information, see Configuring a Selected Value.
Predefined constants. If an argument has a predefined list
of values, QuickTest provides a drop-down list of possible
values. If a list of values is provided, you cannot
manually type a value in this box.
Specifying the Location for the Return Value
If the selected operation returns a value, you can specify
that you want to store the value by selecting the Return
Value check box. When this check box is selected, a default
variable is displayed as the return value location.

You can supply a different variable definition by editing
the value. You can select a different storage location for
the return value by clicking the displayed value and then
the output storage button . For more information, see
Storing Return Values and Action Output Parameter Values.

Viewing the Step Documentation in the Keyword View
If you open the Step Generator from the Keyword View, the
Step documentation box at the bottom of the Step Generator
dialog box can display summary information on the current
step in an easy-to-read sentence.

If you select either the Test Object or Utility Object
category and you define all the mandatory and required
values for the current operation, the Step documentation
box describes the operation performed by the step. When the
step is inserted into your test, this description is
displayed in the Documentation column in the Keyword View.

If all the mandatory and required argument values have not
been defined for the operation, the Step documentation box
displays a warning message.

Note: If you select the Functions category, step
documentation is available for user-defined functions, if
you provided this information when defining them. For more
information, see Documenting the Function.

Viewing the Generated Step in the Expert View
If you open the Step Generator from the Expert View, the
Generated step box displays the defined statement for the
step.

If all the mandatory and required argument values have not
been defined for the operation, the names of the undefined
arguments are highlighted in bold text. If you attempt to
insert the step, an error message is displayed.

Viewing the Generated Step in a Function Library
If you open the Step Generator from a function library, the
Generated step box displays the defined statement for the
step.

If all the mandatory and required argument values have not
been defined for the statement, the names of the undefined
arguments are highlighted in bold text. If you attempt to
insert the step, an error message is displayed.

Inserting Steps
After you define all mandatory argument values for the
current operation, the following options are available:

To insert the current step and close the Step Generator,
make sure the Insert another step check box is cleared.
When you click OK, the step is added to your test and the
Step Generator dialog box closes.
To insert the current step and continue adding steps at the
same location, select the Insert another step check box.
The OK button changes to Insert. When you click Insert, the
current step is added to your test and the Step Generator
dialog box remains open, enabling you to define another
step.
When you insert a new step using the Step Generator, it is
added to your test after the selected step, and the new
step is selected. For more information on the hierarchy of
steps and objects and the positioning of new steps, see
Understanding the QuickTest Object Hierarchy.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what type of framework u r using in ur organization

1648


www.icici.com after this home page wll came, in this page what r the items we r going to test for manual and what the element we r test for QTP... explian clearly with example

1498


I have enrolled for a QTP course which is a four weekend course.Do you think its a good way to start off learning this tool?What all do i need with me in order to become a pro at using this tool?

1671


What are some test assets and related extensions of qtp?

551


How you can decide which type of object repository you have to use?

701






When do go for loop condition in test?

654


For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?

614


What is debugging? How you debug your script?

606


what is run action?

1435


Discuss the QTP Environment?

622


How to Upgrade or support firefox 2.0 version on QTP 9.0? I have installed QTP 9.0 and installed firefox 2.0. But in REcord and Run Settings, it shows firefox 1.5 in Web tab for browser selection.

1783


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1627


Explain about Test Fusion Report of QTP?

611


What is quicktest professional window?

557


Hi Every body please explain me in steps to use checkpoints and object Repositories in QTP for Flight Reservation application please tell me the steps for this its urgent pls thanx for urs answers

1575