Subscribe by Email


Thursday, August 23, 2012

What are different types of functions available in WinRunner?


Functions form a very important aspect of the winrunnner. When you work with the winrunner you are provided with functions from all the categories. 

Some of the functions are there which are suppose to work only when the applications have been developed in specific environments like those mentioned below:
  1. Visual basic
  2. Power builder and so on.
What is a Function?
- The availability of a specific function can be checked by clicking up on the availability button available at the top of the help screen for that particular function. 
- The loadrunner GUI vusers types make use of the winrunner for the creation of the system load.
- This makes it possible to make use of any of the categories. 
- The standard functions can be used apart from the loadrunner functions in loadrunner scenario scripts on UNIX platform only.
- There are certain TSL functions that have the support for both the Xrunner and winrunner. 
- The winrunner provides 4 major types of TSL functions as stated below and a different and unique requirement is addressed by each of them:
1. Context sensitive functions: These functions hold the responsibility for performing the operations on GUI objects.
2. Analog functions: These functions hold the responsibility for carrying out some user like events like mouse and key board input.
3. Customization functions: These functions hold the responsibility for configuring the settings of the testing tool according to one’s requirement. 
4. Standard functions: These functions hold the responsibility for performing the basic programming language operations.

Context Sensitive Functions
- The actions taking place on the software system or application which is under test can be depicted by these functions in terms of the GUI objects like buttons, lists and windows and so on. 
- These functions are available for the following platforms:
      a)   Winrunner
      b)   Load runner GUI vusers
   - Parameters that make a reference to the logical name of some object are involved in most of the context sensitive functions. 
   - However, it should be checked that the logical name of an object has been given a place with the physical description. 
    - What happens during recording is that the logical name is automatically put to use by the system. 
   - In some cases the function is expected to work with the physical description of the object as well.

    Analog Functions
   - Operations are recorded and executed at the screen coordinates of the screen as specified in the test script. 
   - When the winrunner recording is done in this mode, these functions come in to play for depicting the following:
a)     Mouse clicks
b)     Key board input
c)     Exact coordinates travelled by the mouse
- The purpose of these functions is to run and retrace the mouse tracks and submit the exact input that was recorded by the user. 
- There are some other particular operations that are supported by analog functions:
a)   Synchronization
b)   Verification
c)   Text manipulation etc.
- The analog functions are available for the same platforms as for the context sensitive functions.

Customization Functions
- With these functions, the testing tools you are using can be enhanced further to suit better with your testing style and other specific needs. 
- One particular example for this function is the function using which functions can be added to the function generator and custom GUI check points can be created. 
- These are only available for winrunner.

Standard Functions
- These functions are for general elements of the programming language like:
a)   Basic input and out put
b)   Control flow
c)   Mathematical functions
d)   Array functions and so on.
- Unlike other function the standard functions are available for all the products of mercury interactive.  


Wednesday, August 22, 2012

When do you use Verify/Debug/Update Modes? (in Winrunner)


After you have developed the test scripts and finalized your test case, your next step is to run that particular test in order to check the behaviour of your software system or application. Whenever a test is executed using the winrunner, line by line the whole test is interpreted by the winrunner.  
As the TSL statements are interpreted line by line they are marked by an execution arrow which is visible in the left margin of the test script. As the test continues to be executed your software system or application is executed as if it is being controlled by a person. 

The winrunner provides 3 modes for the running your tests namely:
  1. Verify run mode
  2. Debug run mode
  3. Update run mode
In this article we talk about the above mentioned three different types of winrunner run modes. 
- The first mode i.e., the verify run mode checks the application. 
- The second one i.e., the debug run mode debugs the test scripts.
- The third one i.e., the update run mode updates the expected results. 
- Only two modes i.e., the debug run mode and the verify run mode are available when you are using the winrunner run-time.
- Any one of these modes can be chosen from the list on the test tool bar. 
- The verify run mode represents the default run mode in winrunner. 
- You can either run the entire test or just a portion of it using the test and debug menu commands. 
- But always make sure all the necessary GUI map files have been loaded before you start with a context sensitive test. 
- You also have the choice of running individual tests or a group of tests using a batch test. 
- Batch test seems to be quite useful when you have very long tests to be executed and you need an overnight run. 

Now we will discuss about all the three run modes in detail one by one:
Verify run mode: 
- In this mode the current response of your software system or application is compared to the expected response by the winrunner.
- The results of this run mode are called verification results and enlist all the discrepancies that might have been observed in the current response and the expected response. 
- When the execution of the test stops, the verification results window is by default opened for the user to see. 
- As many sets as required of the verification results can be obtained. 
- However, you should always be ready with the expected results for the check points that you created earlier. 
- If there is any requirement for updating the expected results you just need to run the test in update mode.

Debug run mode: 
- This mode also helps in rooting out many of the bugs that might be residing in a test script. 
- The execution of a test in verify mode as well as debug is almost same, the only difference being in the folder in which the results are saved. 
- In this case the test results are saved in the debug folder. 
- Also, here only one set of debug results is stored and so the folder does not opens automatically for the user to view. 
- In this mode, the thing to be taken care of is that the time out variables must be changed to zero while the debugging 0of the test scripts take place.

Update run mode: 
- This mode helps in the updating of the expected results as well in the creation of a new expected results folder.
- Results for a GUI check point can also be updated and an additional set of expected results can also be created. 


Tuesday, August 21, 2012

When do you use Break Points? What is Toggle Break Points? How it differ from Break points?


What you got to do when you are in need of pausing a test run in between its execution? 
- Break points are used to mark such points in the test script where you want the test to be paused. 
- Break points have proved to be a very useful tool in the discovery of the flaws that might be present in a test script. 
- A break point marker marks the break point present in the test script. 
- This break point marker resides in the left margin of the test scripts.
- The test run is paused by the winrunner whenever it encounters a break point. 
- On a particular break point following tasks can be carried out:
  1. The effects of the test run can be examined.
  2. The current value of the variables can be viewed.
  3. Any necessary changes can be made.
  4. Test can be continued to further execution.

How to use Break Points?

- To continue the execution of the test after completing the task to be carried out on the break point the “run from arrow” command can be given and the test will restart from the break point. 
- Once, it gets in to the execution process again it will continue to execute until and unless it encounters another break point or till the test is complete. 
- One thing that should always be taken care of is to make sure that the winrunner is out of batch mode otherwise it won’t pause. 
- For winrunner to pause on break points, it is mandatory that it comes out of the batch mode. 
- If it is not, it is sure to ignore the break points. 
- There are 3 main uses of the break points:
  1. They are used to suspend the test run at a particular point so that the state of your software system or application can be inspected.
  2. They are used for monitoring the entries that are there in the watch list.
  3. They are used to mark certain points throughout the test script for the stepping purpose by using the step commands.

Types of Break Points

We have two types of break points as mentioned below:
  1. Break at location point: This break point makes the test to stop at some line number specified by the user in a test script and
  2. Break in function point: This break point makes the test to stop whenever a functioned specified by the user is called in a loaded compiled module.
The break points that you define in a session remain active for that particular winrunner session only. Once you terminate that particular winrunner then you must redefine the break points to continue the debugging of the test script in the successive session.

Toggle Break Point and how they differ from normal break point

- Toggle break point command is used whenever you have to set a break at the location break point. 
- For doing this, you just need to move the point of insertion to that line of the test script where according to your desire the test must stop executing. 
- Now go to the debug menu and click on the option “toggle break point” or you can simply go for the button entitled toggle break point. 
- Once you have clicked on this you can observe a symbol of break point towards the left margin of the current window of the winrunner. 
- This break like other break points is also listed in the break points list.
- There is just one simple difference which is that the toggle break points automatically make use of the pass count of 0 and if some other pass count is required these break points can be easily modified. 


What is meant by Step and Step into in WinRunner?


Winrunner provides certain run commands commonly known as the winrunner run commands which help in the execution of your test cases. Whenever a test is in the process of running, it is marked by an execution arrow in the left margin of the test scripts indicating that particular TSL statement has been interpreted. 
The winrunner provides 6 typical run commands which have been mentioned below:

1. Run from top: There is also a button corresponding to this command called the “from top” button and clicking on this will cause the active test to start running from the first line of its test script. If another test is called by a test then the test script of the called test is also displayed by the winrunner. The execution takes place till the last line in the test script has been entered.

2. Run from arrow: There is also a button corresponding to this command called the “from arrow” button and clicking on this will cause the active test to start running from that line of the test script which has been marked by an execution arrow. In rest of aspects, this command shares a lot common with the previous mentioned command.

3. Run minimized commands: These commands help in making sure that the entire screen is available to the software system or application that is being tested. Actually, when you use the minimize commands the winrunner window is shrunk to an icon while the test keeps on executing. When the test comes to an end or is paused or stopped the winrunner grows back to its usual size. The following are the available run minimized commands:
        a)   Run minimized > from arrow command and
        b)   Run minimized > from top command

    4. Stop command
   5. Pause command: This command is used whenever there is a need for the temporary suspension of the test run.
   6. Step commands: These commands help in the execution of a single TSL statement in a test script. Buttons called step buttons are also available for these step commands. Step commands available are:
           a)   Step command
           b)   Step into command
           c)   Step out command
           d)   Step to cursor command 
   
   We shall now discuss these step commands in detail. 
    - After a test has been created, it should be checked that whether or not it runs smoothly without giving any errors in logic as well as in syntax. 
   - The step commands come very handy for the detection and isolation of the defects present in the test script. 
    
    With the help of step command, a single line of the test script can be executed. You can either choose the step command or go for step button for the execution of the current line of the script which has been marked by the execution arrow.

- With the help of step into command, another user defined function as well as test can be called and displayed as well. 
- If a function is called by the current line of the active test script then the function settings and startup applications are not implemented. 
- Later, the step out or step commands can be used for a continuous run of the test.
   - The step out command is often applied in conjunction with the step into command i.e., it is used only after you have entered the user defined function or test and thus completes the execution of the user defined function or the called test. 
   Now what if you want to run a particular portion of the test script? Here in such cases you can use the step in to cursor command. 
   - This command helps in executing a portion of the test script that has been selected by the user. 











Monday, August 20, 2012

What is meant by Function Generator in WinRunner?


With the aid of visual programming it has been possible to add the TSL statements to the test scripts. Whenever a test is recorded, TSL statements in the test script are generated by the winrunner whenever a user interaction takes place like some input is supplied from the key board or a GUI object is clicked. 
Apart from the record-able functions, TSL comes with many other powerful functions that add considerable flexibility to your test scripts. These functions can be added to the test scripts with the help of the function generator which is the winrunner’s only visual programming tool. 

The function generator is actually an error free and a quick way to obtain good program scripts. 

Tasks carried out by Function Generator

With the help of the function generator the following tasks can be carried out:
1. It helps you in adding the context sensitive functions which help in obtaining information from the software system or application that is being tested and performing operations on the GUI objects.

2. With the help of function generator you can even add some analog as well as standard functions for performing the tasks that are non context sensitive like for example, appending some user defined messages to the test report or doing synchronization of the test execution.

3. Customization functions can be added that help in the modification of the winrunner in accordance with the testing environment. 

Functions are added by the function generator in form of TSL statements. These TSL statements are added in either of the two following ways:

1. By choosing a function from the list: This is the default way of adding functions. A default function is suggested by the winrunner for the GUI object that has been pointed to. Usually the added function is the one that retrieves information or is a get function.

2. By pointing to a GUI object: This is the advance method and should be used by experts as recommended. First, the insert function command is chosen by the user and a GUI object is pointed. Instantly an appropriate context sensitive function is suggested by the winrunner and values are also assigned to its arguments by the winrunner itself. The function suggested by the winrunner can either be modified along with its arguments or a different function can be chosen to replace it. 

More about Function Generator...

- Once the TSL statements to be added have been generated, they can be either pasted in to the test script or can be executed using the function generator. 
- Function generator can be customized in order to make an account for the user defined functions that are quite frequently used in the test scripts. 
- Function generator can be further enhanced by adding to it many other new functions, categories as well as sub categories. 
- For every new category that is added, a default function can be set and also an already existing default function can be changed. 
- Before generating a function for a GUI object, it is thoroughly examined by the winrunner. 
- After determining its class, an appropriate function for that particular object is suggested by the winrunner. 
- This suggested default function can either be accepted or rejected and if rejected a new one can be picked up from the list. 
- For selecting a non default function for the GUI object you need to go to the insert menu, selection function option, then select the option “for object/ window” or you can simply click the insert function for object/ window button present on the user tool bar. 
- Point to the GUI object you wish to be affected and left click. 
- A function generator dialogue box appears, click change option in it.  



Sunday, August 19, 2012

How do you program tests with Test Script language (TSL)?


The tests that are created by the winrunner are composed of the statements that have been coded in a special language by the mercury interactive called Test Script Language or TSL in short form. 
- The tests created can be further enhanced by using the TSL language.
- Remember, this feature which allows the modification of the test scripts via the TSL language is not available in the winrunner runtime.
- The generation of TSL statement takes place whenever a test is recorded by the winrunner. 
- Each line of the test generated by the winrunner is called a TSL statement and is as usual followed by a semi colon like in many other programming languages.
- Each and every TSL statement consists of some user input like mouse click or input from key board to be fed to the software system or application that is to be tested. 
- The length of the TSL statement varies from line to line of the test script. 
- TSL can be thought of more like the C programming language that has been designed for the creation of the test scripts. 
- Some certain specific functions like those mentioned below are combined by the TSL:
  1. Variables
  2. Control flow statements
  3. User defined functions
  4. Arrays and so on.
- A recorded script can be further enhanced just by typing the programming elements in to the winrunner test window.
- However, the TSL proves to be quite useful when compared to C because in test script language there is no need of compilation of the written code. 
- The test is just written or recorded and immediately subjected to execution. 
- Four types of functions constitute the TSL:
  1. Analog functions
  2. Context sensitive functions
  3. Customization functions and
  4. Standard functions.

How TSL can aid in the creation of tests?

 
- The tests developed using TSL are basically of descriptive nature and thus this type of programming is called the descriptive programming. 
- A logical name is assigned to an object the very moment it is added to the GUI map. 
- Once a GUI object makes its place in the GUI map, it becomes quite easy for you to add any TSL statements to it. 
- The logical name that is given to the object is as such that it gives a description of the GUI object. 
- During the execution of the tests, the objects are discovered based on their logical names itself but for the identification other property values that are stored in the map are used. 
- These logical names of the GUI objects can be further modified so that it becomes quite easy for you for the identification of the tests. 
- While programming with TSL, the statements that perform functions on objects can also be added without making a reference to the GUI map. 
- But doing that requires entering some more information regarding the description of the object so that it can be uniquely identified during the test run. 
- This is the essence of the descriptive programming using TSL. 
- While doing the programming, if you forget which values and properties of the object were to be identified you can take help of the GUI spy for viewing the current properties of the object as well as its values. 
- Stress conditions can also be created while programming with TSL which are designed for the determination of the limitation of the software system or application. 
- Stress conditions can be created by creating a loop that executes a block of TSL statements for number of times specified by the user.  


What are different types of running a test in WinRunner?


After you are done with the creation of the test scripts for your cases, you subject them to be compiled by the winrunner which in turn interprets these test scripts line by line. Ultimately, the tests are executed as though they were being run by a real world human user. 

In this article we are going to discuss about different types of running a test in winrunner. 

1. Running a test to check the software system or application:  
This type of test run involves a rigorous check of the behavior of the software   system or application as well as a sincere comparison among the current results and the expected results. The folder where you want the verification results to be saved can be specified by you itself. Following steps are followed for this type of test run:
a)   For opening your test hog down to open option in the file menu and click it to open a test.
b)   But be first make it sure that you have set the run mode to verify run mode on the test tool bar.
c)   Now choose an appropriate test menu command or you simply click on one of the run options. When you do this a run test dialogue box appears.
d)   It is your wish if you want to save your test results with a default test run name.
e)   The winrunner saves the test results.

    2. Running a test for debugging a test script: 
   Whenever you have to debug the test scripts a similar type of comparison is carried out by the winrunner as in the previous type between the current response and the expected response. After debugging only one set of debug results is saved in the debug results folder. So whenever you carry out a second execution of the same test, the results are over written by the winrunner. Following steps can be carried out for this type of test run:
    a)   Follow the same step a in the previous test run type to open a test.
    b)   Then go for the debug option from the list of run modes on the test tool bar.
    c)   Then you go for the run or debug menu command that you want.
    d)   For executing the entire test go for the “run from top” option available in the test menu.

    3. Running a test for updating the expected result: 
    This type of test run helps one in updating the expected results. In this case, the expected results that were created earlier are replaced by the new results and these new results in turn become the subject of comparison for the subsequent test results to come. For running a test for updating the expected results follow the first step as given in the previous two cases for opening a test. Go to the list of run modes from the test tool bar and select the update option. Then choose an appropriate test menu command from the list. For updating the entire set go for the option “run from top” in the test tool bar or simply click on the “from top” button on the tool bar.

    4. Running a test for checking the date operations: 
   Once a test has been created that checks date operations, it is run to check in what way the software system or application responds to the date information present in the test. You must make sure that in the general category of the options dialogue box the option “enable date operations” must have been selected. 


Facebook activity