Showing posts with label WinRunner. Show all posts
Showing posts with label WinRunner. Show all posts
Recording Test Case
| WinRunner | |||
| Recording Test Case | |||
| To test any application, you can run the application and understand its operation. Then you can invoke win runner, again run the application and record the GUI operations. During the recording mode, win runner will capture all the actions, which button you pressed, where you clicked the mouse etc. You need to work with the application as usual and perform all the actions to be tested. Once the recording is completed, win runner generates a script in TSL. You can run this test script to view the results of the test cases. | |||
| There are two modes of testing: | |||
| |||
| Recording in context sensitive mode | |||
| |||
| Recording in Analog mode | |||
| |||
To view the presentation of Recording in Analog Mode, click here! | |||
Running the Test
GUI Map File
| WinRunner | ||
| GUI Map File | ||
| In win runner, if you run a test without loading thee corresponding GUI map file, it generates an error as it fails to identify the controls used in the test cases. For example, suppose you have recorded a test for inverse function for the calculator application and forgot to save its GUI map file. When you close the test case and again open it run the test case, an error message is generated. | ||
| Even if you save the GUI map file but forget to load the corresponding GUI map file, generates the error message. | ||
| Win runner may generate some ambiguous or wrong results but not errors if the application is not brought back to base state before trying to run the application. | ||
Adding GUI objects to the GUI Map
| WinRunner | |||
| Adding GUI objects to the GUI Map | |||
| If you’re application contains some new objects, you can add them to the GUI map without running the rapid test script wizard again. You simply use the learn button in the GUI map editor to learn descriptions of the objects. You can learn the description of a single object or all the objects in a window. | |||
| |||
Checking GUI objects
| WinRunner | |||
| Checking GUI objects | |||
| When working with an application, you can determine whether it is functioning properly according to the behavior of GUI objects. If a GUI object does not respond to input as expected, a defect probably exists somewhere in application’s code. You check GUI objects by GUI checkpoints. A GUI checkpoint examines the behavior of an object’s properties. | |||
| To create GUI checkpoint for a single object, you first point to your application. If you click the object, a checklist with the default checks for the object is inserted into your test script. A checklist contains information about the GUI object and the selected properties to check. | |||
| Checking a single property | |||
| In order to check a single property of one particular object, you need to create the checkpoint for a single object as follows. | |||
| •Go to CREATE>GUI CHECKOINTS>FOR SINGLE PROPERTY | |||
| On selecting this option, it prompts you to select the object for which the checkpoint has to be created. Select the required object. It will then display the check property dialog box. | |||
| Select the required property, on which the object has to be checked, by selecting a value from property. Win runner will automatically assigns the default value to that function. | |||
| Checking a single object | |||
| If you want to create checkpoints for multiple properties of a single object, then checkpoint for single object is used. The checkpoint can be created as follows: | |||
| •Go to CREATE>GUI CHECKOINTS>FOR SINGLE OBJECT/WINDOW. | |||
| Checking for multiple objects | |||
| The checkpoints for multiple objects can also be created. This is used to check the property of various objects. To create checkpoints for multiple objects, select “for multiple object”. | |||
| •Go to CREATE>GUI CHECKOINTS>FOR MULTIPLE OBJECTS. | |||
Adding GUI checkpoints to a test script
| WinRunner | |||
| Adding GUI checkpoints to a test script | |||
| |||
| |||
| The GUI checkpoint can be for single property or object/ window or for multiple objects. | |||
To view the animated presentation of GUI Checkpoints, click here! | |||
Synchronizing the test
| WinRunner | |||
| Synchronizing the test | |||
| In this, you will insert a synchronization pointing the test script created. | |||
| |||
| a | |||
| Changing the synchronization setting | |||
| The default intervals that win runner wait for an application to respond to input is 10 seconds. We can add a synchronization point to solve it. | |||
| |||
Synchronizing the test
| WinRunner | |||
| Synchronizing the test | |||
| In this, you will insert a synchronization pointing the test script created. | |||
| |||
| Changing the synchronization setting | |||
| The default intervals that win runner wait for an application to respond to input is 10 seconds. We can add a synchronization point to solve it. | |||
| |||
Bitmap checkpoint
| WinRunner | |||
| Bitmap checkpoint | |||
| If your application contains bitmap areas, such as drawings of graphs, you can check these areas using a bitmap checkpoint. A bitmap checkpoint compares captured bitmap images pixel by pixel. Win runner captures a bitmap image and saves it as expected results. When you run the test, win runner compares the expected and actual values. If any differences are detected, you can view a picture of the differences from the test result. | |||
| Adding Bitmap checkpoint to a test script: | |||
| |||
Data Driven testing
| WinRunner | |||
| Data Driven testing | |||
| Once the test script is created, we may sometimes want to check how the test script behaves for multiple data. This can be done by creating that many number of test cases and by running each test case individually, which is very long process. In such cases we use of data driven wizard. This involves 3 steps. | |||
| |||
| Converting test to Data Driven test | |||
| |||
| Adding Data to the Data table | |||
| When you will parameterize your test, you can add the data that the parameterized test will use. | |||
| |||
| Data driven testing tips | |||
| |||
| You can change the active row, or read from a non active row during the test run by using TSL statements. | |||
Rapid test script wizard
| WinRunner | |||
| Rapid test script wizard | |||
| The rapid test script wizard is the fastest way of performing the test process. It systematically opens up all the windows in the application, stores the learnt information in the GUI map file and generates the test cases based on the information learnt from the application. It is possible to apply these tests only on those applications, which opens window upon performing some task. Let us take an example to apply this wizard on calculator. | |||
| |||
Why test failed?
| WinRunner | |||
| Why test failed? | |||
| Rapid test wizard does not provide statements in the test script for closing the windows. In the preceding example, win runner opened ‘about calculator’ dialog and without closing the ‘about calculator’ dialog, it is trying to set focus to the ‘calculator’ window and as a result test fails. | |||
| To overcome this, manually you need to close the previous window before trying to open the next window. To close the ‘about calculator’ window before setting the focus on to calculator, insert the following statement: | |||
| Win_close(“About calculator”); | |||
| While learning the windows, win runner stores the images of the windows internally and creates a checkpoint for each image automatically. When the user runs the test script, if any of the window does not matched the captured image, it will give mismatch error. | |||
| Consider the ‘About calculator’ dialog box. In this dialog box the system resources may vary. While learning this window, the “system resources” was 71%, but while running, if this value changes, then win runner will find mismatch. So see whether the value of “system resources” is 71% or not. Then run the test script. It will show the result. | |||
| Program tests with TSL | |||
| When you record a test, win runner generates TSL statements in a test script each time you click a GUI object or type on the keyboard. In addition to the recorded TSL functions, TSL includes any other built in functions which can increase the power and flexibility of your tests. You can quickly add these functions to a test script using win runner’s visual programming tool, the function generator. The functional generator enables you to add TSL functions in two ways: | |||
| |||
| You can further enhance your test scripts by adding logic. Type programming elements such as conditional statements, loops and arithmetic operators directly into the test window. | |||
Recording a Basic test script
| WinRunner | ||
| Recording a Basic test script | ||
| ||
Subscribe to:
Posts (Atom)