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

Answers were Sorted based on User's Feedback



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

Answer / amit

ANDY - Everyone knows that help file can prove the answer.
So u don't need to give your spl comments on help file. If u
don't know the answer then don't give advices.

Is This Answer Correct ?    34 Yes 8 No

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

Answer / andy

Step generator is a feature availabe in QTP which helps to
generate the script without recording and/or without typing
the script in Expert View.

For Detail go to help file and type "Step Generator"

It will tell us how to add the steps.

Is This Answer Correct ?    29 Yes 7 No

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

Answer / james

someone is asking in detail..every one can go to help
section and than what is the use of this forum

Is This Answer Correct ?    29 Yes 7 No

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

Answer / anil

I would like to add following points regarding Step
Generator:-
1) Without using Record we can generate scripts using Step
Generator
2) Disabled objects can be recorded by Step Generator

Go to tool bar: Insert->Step Generator(or u can use F7
functional key)
I)Step Generator Dialog box will open
II)There are 3 Categories you can choose from:
(a)Test Object(e.g.operation performing with the Objects)
(b)Utility Object(SystemUtil)
(c)Functions(Under Finctions there are three libraries:-
Library functions, Built-in functions and Local script
functions)
Note: Library and Locak script functions are user-defined

e.g. Steps to use Test Objects:
i)AUT(Application Under Test) should be opened
ii) Go to tool bar of the QTP : Insert->Step Generator-
>Select Category as 'Test Objects' and Insert another step
should be selected on the 'Step Generator' dialog box
iii) Click on 'Select Object icon->Select Object for step
dialog box will open
iv)Click on Hand Mark
v) Click on Application bar-->Click on Insert button-
>Script will be generated

Is This Answer Correct ?    23 Yes 4 No

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

Answer / sivakumarreddy

Go to tool bar: Insert->Step Generator(or u can use F7
functional key)
I)Step Generator Dialog box will open
II)There are 3 Categories you can choose from:
(a)Test Object(e.g.operation performing with the Objects)
(b)Utility Object(SystemUtil)
(c)Functions(Under Finctions there are three libraries:-
Library functions, Built-in functions and Local script
functions)
Note: Library and Locak script functions are user-defined

e.g. Steps to use Test Objects:
i)AUT(Application Under Test) should be opened
ii) Go to tool bar of the QTP : Insert->Step Generator-
>Select Category as 'Test Objects' and Insert another step
should be selected on the 'Step Generator' dialog box
iii) Click on 'Select Object icon->Select Object for step
dialog box will open
iv)Click on Hand Mark
v) Click on Application bar-->Click on Insert button-
>Script will be generated

Is This Answer Correct ?    7 Yes 1 No

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

Answer / 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

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

Answer / anjireddy.idamakanti

It is used to generate steps in the Test pane without click
on start Recording.
Step Generator consists of statements in three categories
such as
(i) Functions
(ii) Utility objects
(iii) Test Objects.

(i) Functions

This category specifies all general and mathematical
operations such as left, right, len, time, cint, cdbl, cstr,
ltrim, rtrim, trim etc.,
(ii) Test Object
This category specifies the operations which are performed
on the objects such as Set, Select, Activate, SetSecure,
Click, GetVisibleText, GetROProperty, GetTOProperty,
GetItem, GetItemCount, GetContent …. Etc.,
(iii) Utility Objects
This category specifies all miscellaneous operations such as
DataTableOperations, SystemUtil Operations, QCUtil
Operations, Recovery Operations etc.,

Ex

Prepare script for calculation Test in Application Flight
Reservation
Option explicit Dim x,y,tot,i
For i = 1 to 5 step 1 Window("Flight Reservation").Activate

Window("Flight Reservation").WinMenu("Menu").Select
"File;Open Order..." Window("Flight
Reservation").Dialog("Open Order").WinCheckBox("Order
No.").Set "ON"
Window("Flight Reservation").Dialog("Open
Order").WinEdit("Edit").Set i Window("Flight
Reservation").Dialog("Open Order").WinButton("OK").Click
x = Window("Flight
Reservation").WinEdit("Tickets:").GetVisibleText()

y = Window("Flight
Reservation").WinEdit("Price:").GetVisibleText() y=mid(y,2,
len(y)-1)
tot = Window("Flight
Reservation").WinEdit("Total:").GetVisibleText()
tot=mid(tot,2, len(tot)-1)

If cdbl(tot)=cdbl(x) * cdbl(y) Then

reporter.ReportEvent micPass, "Calculation is correct",
"Test is Pass" else

reporter.ReportEvent micFail, "Calculation is not correct",
"Test is fail"

End If Next

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More QTP Interview Questions

Explain about import and export files?

1 Answers  


What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????

0 Answers   Infotech,


why the smart identification is not there in WinRunner

1 Answers   DigiTech,


How to Creating an Output Value using QTP?

1 Answers  


Can any one explain me what is the procedure to connect the remote desk by using QTP 9.2 ?

0 Answers   IGI,






how can we return a value from userdefined function for eg 2 functions in func1 iam getting 2 values(a,b) and storing in var(C). now i want to pass that var(c) to another func2 give me the script

1 Answers  


How you can write contexts to text file in qtp?

0 Answers  


What is output value? How many types of output values are there in qtp?

0 Answers  


What are the details steps to connect a remote mysql database in QTP

1 Answers   Verizon,


Hi Friends, How to trap an error message on Web page through QTP. Example:- When I put wrong user id or Password on a web page, I get the error message. So when I add the error object in Reposatory, every time it shows as Login Failed Object exist, eventhough using corret login details. And if I do the same without adding the object it shows as object not found. This might be because while recording QTP takes every new page as _1 _2 _3 and so on. as below. Browser("XXXXX").Page("XXXXX_1"). >>login Browser("XXXXX").Page("XXXXX_2"). >>Inbox Browser("XXXXX").Page("XXXXX_3"). >>Sent Items I used below code. Browser("XXXXX").Page("XXXXX").WebEdit("firstname").Set strFN Browser("XXXXX").Page("XXXXX").WebEdit("lastname").Set strLN Browser("XXXXX").Page("XXXXX").WebEdit("userid").Set strUserID Browser("XXXXX").Page("XXXXX").WebEdit("password").Set strPass Browser("XXXXX").Page("XXXXX").WebButton("Login >").Click If Browser("XXXXX").Page("XXXXX_2").Image ("msg_icon_error").Exist 5 Then Reporter.ReportEvent micFail, "XXXXX", "Login Failed!" ExitRun (It shows login failed ever after login is passed. Else Reporter.ReportEvent micPass, "XXXXX", "Login Successful!" End If Please find out a way for me here, and provide me with the correct code. Thanks in Advance.

1 Answers  


how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can you kindly let me know in details steps on How we can connect to database. i am using QTP9.2 and SQL Server Database. I am new for QTP and this would be of great help.Thanks

2 Answers  


How u execute test cases in manual testing?

2 Answers   Accenture, Infosys,


Categories