Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 14

Advanced QTP:

Working with Win-Runner


Working with winrunner

Working with winrunner Overview Session: Agenda


• Quick Insight
• Difference between QTP and Winrunner ?
• Working With Winrunner in QTP

– Connecting Quick Test to Win-runner


– Call To WinRunner Test
– Passing QuickTest Parameterized Values to a WinRunner Test
– Call to Win-runner Function
– Viewing the Results
– summary

Accenture Confidential. For Internal use Only. 2


Working with winrunner

Working with Win-runner – Quick Insight

• Centralized Automated solution .


• Working with winrunner option helps you maintain a project of all kinds
of tests(eg. Qtp, winrunner) .
• provides an intuitive and efficient method for scheduling and running
tests, collecting results, analyzing the results, and managing test
versions .
• It also features a system for tracking defects, enabling you to monitor
defects closely from initial detection until resolution
• Can be easily parameterized , can call user defined functions in
winrunner .

Accenture Confidential. For Internal use Only. 3


Working with win-runner

About Working with WinRunner


• What is Win-runner?

• Difference between Win-runner and QTP

WinRunner QTP
1) Approach Procedural Object oriented
2) Language TSL Visual Basic Script
3) Programming More Less
4) Recording Doesn't capture screen Captures screenshots as
Activescreens during
recording
5) Running Does not display screens Displays screens running tests
while running tests

Accenture Confidential. For Internal use Only. 4


Working with winrunner

About Working with WinRunner

• When you work with QuickTest, you can also run Win Runner tests and call TSL
or user-defined functions in compiled modules.
• If you have WinRunner 7.5 or later installed on your computer, you can include
calls to WinRunner tests and functions in your QuickTest test or Component
• Once you create a call to a WinRunner test or function, you can modify
parameter values in existing call statements by editing them in the Expert View.
• When QuickTest is connected to a Quality Center project that contains
WinRunner tests or compiled modules, you can call a WinRunner test or function
that is stored in that Quality Center project.

Note:
• For WinRunner versions earlier than 7.6, you cannot run WinRunner tests on Web pages (using
WinRunner’s WebTest Add-in) from QuickTest if the QuickTest Web Add-in is loaded. For
WinRunner 7.6, you can enable this Functionality by installing patch WR76P10 - Support WR/QTP
integration from the patch database on the Mercury Interactive Customer Support site
(http://support.mercury.com).

Accenture Confidential. For Internal use Only. 5


Working with winrunner

Connecting Quick Test to Win-runner

• To insert a call to a WinRunner test using


the Call to WinRunner Test dialog box:
1) Choose Insert > Call to WinRunner >
Test (The Call to WinRunner Test dialog
box opens )
• In the Test path box, enter the path of the
WinRunner test or browse to it.
• If you are connected to Quality Center
when you click the browse button, the
Open WinRunner Test from Quality
Center project dialog box opens so that
you can select the module from the
Quality Center project

Accenture Confidential. For Internal use Only. 6


Working with winrunner

Call To WinRunner Test

• When QuickTest links to WinRunner to run a test, it starts WinRunner,opens the


test, and runs it. Information about the WinRunner test run is displayed in the
QuickTest Test Results window.
• You can insert a call to a WinRunner test using the Call to WinRunner Test
dialog box or by entering a TSLTest.RunTestEx statement in the Expert View.

Note:
• For WinRunner versions earlier than 7.6, you cannot run WinRunner tests on Web pages (using
WinRunner’s WebTest Add-in) from QuickTest if the QuickTest Web Add-in is loaded. For WinRunner
7.6, you can enable this Functionality by installing patch WR76P10 - Support WR/QTP integration from
the patch database on the Mercury Interactive Customer Support site (http://support.mercury.com).

Accenture Confidential. For Internal use Only. 7


Working with winrunner

Passing QuickTest Parameterized Values to a WinRunner Test

Rather than setting fixed values for the parameters required for a WinRunner
test, you can pass WinRunner parameter values defined in a QuickTest Data
table, random or environment parameter. You specify these parameterized
values by entering the appropriate statement as the Parameters argument in
the TSLTest.RunTestEx statement.
Example :-
Suppose you want to run a WinRunner test on a Windows based Flight
Reservation application, and that the test includes parameterized statements for
the number of passengers on the flight and the seat class. You can pass the
WinRunner test the value for its first parameter from a QuickTest random
parameter (that generates a random number between 1 and 100), and pass it
the value for the seat class from a QuickTest Data Table column labeled Class.
Your TSLTest.RunTestEx statement in QuickTest might look something like
this:
TSLTest.RunTestEx "D:\test1", TRUE, FALSE, RandomNumber(1, 100) ,
DataTable("Class", dtGlobalSheet)
Note:-
• Enhance the tests by parameterizing them where a range of input data is required to test certain
conditions. Parameterize the test to replace fixed values with values from an external source during
test run. The values can come from a Data Table, environment variables you define, or values that
QTP generates during the test run.
Accenture Confidential. For Internal use Only. 8
Working with winrunner

Call to Win-runner Function


When QuickTest links to WinRunner to call a function, it starts WinRunner, loads
the compiled module, and calls the function. This is useful when you want to use a
user-defined function from WinRunner in QuickTest. You call a WinRunner
function from QuickTest by specifying the function and the compiled module
containing the function.
1) Choose Insert > Call to WinRunner > Function.
The Call to WinRunner Function dialog box opens.
2 ) In the Module box, enter the path of the compiled module containing the function
or browse to it. If you are connected to Quality Center when you click the browse
button, The Open WinRunner Test from Quality Center project
the Open WinRunner Test from Quality Center project dialog
box opens so that you can select the compiled module from
the Quality Center project. To call a WinRunner Tsl function,
enter the path of any compiled module.
3) In the Function name box, enter the name of a function defined
in the specified compiled module, or enter any WinRunner TSL function.

Note:
You cannot retrieve the values returned by the WinRunner function in your QuickTest test or business
component. However, you can view the returned value in the results.
Accenture Confidential. For Internal use Only. 9
Working with winrunner

Calling Win-runner function


In QuickTest, the call to the TSL function is displayed as:

• A TSLTest.CallFuncEx statement in VBScript in the Expert View. For


Example:
CallFuncEx "C:\WinRunner\Tests\TlStep","TlStep1",TRUE, 0, "MyArg1"
• The CallFuncEx function has the following syntax:
Example:
TSLTest.CallFuncEx Module Path, Function, Run Minimized, CloseApp [ ,
Arguments ]

Accenture Confidential. For Internal use Only. 10


Working with winrunner

Viewing the Results


• After you run a WinRunner function in WinRunner 7.6 or later from QuickTest,
you can view the results of your function call. The QuickTest Test Results
window shows the start of the WinRunner function and the WinRunner function
results. If the called function included events such as Report_msg or tl_step,
information about the results of these events are also included.

Accenture Confidential. For Internal use Only. 11


Working with winrunner

Questions?

Q & A….

Accenture Confidential. For Internal use Only. 12


Working with winrunner

Summary

• Centralized Automated solution:


– It provides an intuitive and efficient method for scheduling and running tests, collecting results,
analyzing the results, and managing test versions.
– It also features a system for tracking defects, enabling you to monitor defects closely from initial
detection until resolution
– Facilitates calling user defined functions in winrunner.
• Basic differences between winrunner and Qtp :
– Approach
– Language
– Programming
– Recording
– Running
• About Working with WinRunner
– WinRunner Tests can be executed from the QTP by using TSLTest.RunTestEx statement in
VBScript in the Expert View.
– TSLTest.RunTestEx statement can be also used for passing QuickTest Parameterized Values
to a WinRunner Test.

Accenture Confidential. For Internal use Only. 13


Working with winrunner

Summary
1. QTP facilitates calling WinRunner Functions by using the
TSLTest.CallFuncEx statement.
2. TSLTest.CallFuncEx also provides for passing QuickTest Parameters to a
WinRunner Function
3. QTP provides for viewing the Results with respect to the Pass/Fail of
Winrunner tests/functions through its own interface.

Accenture Confidential. For Internal use Only. 14

You might also like