Upload
kernel-training
View
366
Download
8
Embed Size (px)
Citation preview
For more details please contact us:US : +1 718 819 9361INDIA : +91 8099776681Email Us : [email protected]
Welcome to Winrunner 8.2
2 http://kerneltraining.com/winrunner/
Need For Automation Speed - Automation scripts run very fast when
compared to human users. Reliable - Tests perform precisely the same operations
each time they are run, there by eliminating human error.
Repeatable - We can test how the application reacts after repeated execution of the same operations.
Programmable - We can program sophisticated tests that bring out hidden information.
Comprehensive - We can build a suite of tests that covers every feature in our application.
Reusable - We can reuse tests on different versions of an application, even if the user interface changes.
3 http://kerneltraining.com/winrunner/
What is WinRunner
WinRunner is Mercury’s legacy automated testing tool
It is similar to QTP in functionality WinRunner integrates with other Mercury testing
solutions including:• TestDirector/Quality Center• QTP• LoadRunner
Utilizes an add-in architecture for compactness and extensibility
4 http://kerneltraining.com/winrunner/
WinRunner Environment
Windows• C++, Visual Basic, Java, PowerBuilder
Web• Web Applications
Other technologies• SAP, Siebel, Oracle, PeopleSoft, ActiveX
5 http://kerneltraining.com/winrunner/
WinRunner Add-ins ActiveX Controls - For testing software written using
ActiveX technology. This technology allows people to create objects in one language and use those objects within other languages/applications
Visual Basic - For applications written in the Visual Basic language
PowerBuilder - For applications written in the PowerBuilder language
WebTest - For testing web applications written in any language. In web applications, we interact with the application though a web browser and so the web application can be written in any language.
6 http://kerneltraining.com/winrunner/
Testing Process Create GUI Map Create Tests
o Recordo Edit
• Insert checkpoints• Insert synchronization points• Parameterize test• Include TSL code
Debug test Run tests
7 http://kerneltraining.com/winrunner/
WinRunner Object Identification Process
GUI Configuration Tool• The tool determines what properties of
objects are recorded GUI Spy
• Allows users to view the property of an object without recording it
GUI Map Editor• Holds information recorded about each
object allowing the test to identify the object during execution
8 http://kerneltraining.com/winrunner/
Creating a GUI Map
Per Test• A GUI Map is created for each test
Global• A single GUI Map is used for multiple
tests
9 http://kerneltraining.com/winrunner/
CREATE TEST [STEP 2]
Record Steps Edit
• Insert synchronization points• Insert checkpoints• Parameterize values• Include TSL code
10 http://kerneltraining.com/winrunner/
GUI MAP BASICS Recording
• Object is stored in GUI map first• Object is assigned a name• Based on object class and name,
statement is generated in WinRunner script
11 http://kerneltraining.com/winrunner/
GUI MAP BASICS• Replay
– WinRunner searches the current window context in the GUI map (set_window)
– WinRunner searches window for the object name
– Physical description is used to locate object
12 http://kerneltraining.com/winrunner/
GUI MAP TIPS
Learn GUI Map • use the “Learn” feature in
the GUI map editor to store all the objects in a window all at once
• Instead of recording individual objects piecemeal as a record session is progressing, every encapsulated object within another object can be recorded at one time, and ready to be accessed
13 http://kerneltraining.com/winrunner/
GUI MAP TIPS Save the GUI file
• For reuse in future iterations of the automated test
• To possibly be used in different automated tests
14 http://kerneltraining.com/winrunner/
Record
Read the outline of steps to perform Practice performing the steps to minimize
error Choose record mode
• Context Sensitive• Analog
o RECORD Stop, Save test, playback
15 http://kerneltraining.com/winrunner/
Recording
Context-sensitive mode Analog mode Tests can combine both recording modes Context-Sensitive is the default mode Switch between modes using same record
key (F2)
16 http://kerneltraining.com/winrunner/
Recording Tips plan your work
• decide exactly what actions / data to record check initial conditions
• test cases may have data dependency• test cases may have screen dependence• establish a common “initial state” for testing
walk through the test case manually• Verify that the test case is functional before recording
script “test” your test script
• verify that the script will replay reliably by executing several times.
• watch the script execute and verify that it performs its intended function
17 http://kerneltraining.com/winrunner/
Edit Test
Insert synchronization points• Used to slow down execution of a test script
Checkpoints• Used to check expected value of a step
against the actual value at a specific point during execution
Insert Parameterization• Allows you to store data in the data table
Include TSL code• Last option. Very powerful.
18 http://kerneltraining.com/winrunner/
Debug• debug is good to use while the test script is being
debugged• these test results are overwritten with each new run
Verify• Corresponds to actual results• Generally used when executing testing sessions where
results need to be stored Update
• Corresponds to “expected” results. Expected results are the benchmarks used to verify test results
• Test runs in “Update” mode generate the expected results for future runs to compare back against
• These test results become the expected results for subsequent test runs in “Verify” mode
Run Modes
19 http://kerneltraining.com/winrunner/
Synchronization Point
Specific time• Uses the wait function to pause the
test for a specific amount of time [in seconds]
Until an event occurs• Pauses until a specific property of an
object has a specific value
20 http://kerneltraining.com/winrunner/
Checkpoints
GUI• Checks multiple properties of a single object
Text• Checks part or all the text within an object
Bitmap• Checks the visual layout of an entire object or a
portion of the object Database
• Checks data in the database
21 http://kerneltraining.com/winrunner/
Parameterize Data
Allows your test to read data from the data table.
The data table is an Excel spreadsheet file editable from using Excel or any other application that can edit a .xls document
The columns can be renamed by double-clicking on the header of the column.
22 http://kerneltraining.com/winrunner/
TSL Coding
When the tools provided by WinRunner are not sufficient to test an application, TSL coding can be used.
TSL is a proprietary language only used within Mercury tools.
23 http://kerneltraining.com/winrunner/
TSL (Test Script Language)
TSL is a C-like language• High-level proprietary programming
language designed for test automation
• procedural language Full programming support
• variables, arrays, functions• regular expressions• control flow, decision logic, looping
24 http://kerneltraining.com/winrunner/
Built-in TSL Functions
TSL provides a comprehensive library of hundreds of built-in functions to simplify test creation• window/object functions• environment functions• reporting functions• database query functions• file/spreadsheet functions• Win32 functions
WinRunner provides a graphical function browser to assist you • Function Generator
25 http://kerneltraining.com/winrunner/
FUNCTION GENERATOR
26 http://kerneltraining.com/winrunner/
Language Syntax
*** Same syntax as in standard C ***
27 http://kerneltraining.com/winrunner/
Test Verification
Enhancing a test script to verify data onscreen• check objects’ values / states• check images• check text• check the database
Context-Sensitive verification Analog verification
28 http://kerneltraining.com/winrunner/
Recap
Checkpoints - check Synchronization points - wait Parameterization – configuration
data TSL – adds programmable logic
30
Call us: +91 8099776681Email: [email protected]://kerneltraining.com/winrunner/