Recording and Running tests
The
purpose of the using automated testing tools is that they are very fast
and they are extremely accurate and reliable. Whatever activities are
supposed to performed to test our application can be recorded using a
tool and can later be played back as if it is a real user. This
approach is very fast and reliable.
So the first step in the
creating tests in WinRunner is to record user actions. WinRunner
records these and equivalent test script commands are generated. These
are later executed.
As explained above WinRunner can record in
two modes namely Context-sensitive and Analog. Basing on your
requirements select either mode.
Recording in Context-Sensitive mode
In
Context Sensitive mode, WinRunner records only mouse clicks, mouse
drags, button clicks, window resizing, keystrokes etc. but does not
record mouse movements. Here when identifying objects it ignores the
physical location of the object.
Click on Create => Record
Context Sensitive or press the softkey F2. It will start recording in
the CS mode. Switch to you application and do all the actions, which
are to be recorded. To stop recording click on Create => Stop
Recording or press the softkey Ctrl_L+F3. You can also start recording
by clicking on the red record button.
For each action performed
it will create a TSL statement for it. Review the code and edit the
script to suit your needs. Through out the script logical names in the
GUI map files will be used.
Recording in Analog mode
In
Analog mode records mouse clicks, keyboard input, and the exact x and y
coordinates traveled by the mouse. When the test is run, WinRunner
retraces the mouse tracks. We use Analog mode when exact mouse
coordinates are important to our test, such as when testing a drawing
application. Click on Create => Analog. It will start recording
in the Analog mode. Switch to you application and do all the actions,
which are to be recorded. To stop recording click on Create => Stop
Recording or press the softkey Ctrl_L+F3. You can also record in Analog
mode by clicking twice on the red record button on the toolbar. Pixel by pixel every mouse movement is recorded by WinRunner.
Running the test
To
playback the test select Run=> Run from top or press the softkey
Ctrl_L+F5. WinRunner start playing back the TSL statements one after
the other very rapidly. Please check that the application you are
playing back on is in the same state as it was before you recorded the
actions.
You can also playback from any location you choose.
Click on any line of code from where you want to execute, and select
Run=> Run from Arrow or press the softkey Ctrl_L+F7.
The code also can be run line by line. For more information refer to the section Debugging Tests.
|