R. E. Cook
Contact Us 

Dr. Cook

RunningShoes Library for WinRunner 

Custom WinRunner Functions 
and Utilities,
to Your Specs

A Random Collection of WinRunner Solutions

Creating DLLs for WinRunner 
"DLLs Demystified" 
(Mercury Interactive's Worldwide Users Conference 2000)

R. E. Cook Consulting


Tutorial: Your first script with RunningShoes

It's always a challenge to pick up a new tool and start working with it, so this brief tutorial can help you get started. 

First Step

To begin, once you have completed installation of RunningShoes on your PC, you only need to add one line to a WinRunner script to be able to call its functions. So begin with a line to call the initialization script, which handles everything needed to begin using the library. This statement is mandatory; WinRunner must know where a function is defined in order to call that function, whether it is in a DLL such as RunningShoes or in a standard compiled module:

## Load the DLL and declare the functions.
call_close "RunningShoesInit"();

After this line, all functions in the library are available to your script. Call them just as you would call one of WinRunner's built-in functions or a user-defined function.

Calling Functions

Just to convince ourselves it's working, let's use some of the simplest functions to determine the PC where the script is being run, and the user running it.

## Find and display information about the local PC.
pc = ComputerName();
user = UserName();
title = "PC Information";
message = "Computer: " & pc & ", Username: " & user;
PauseOK(title, message);

The first two statements are self explanatory, getting the name of the PC and the user running on that PC. The last line above illustrates an alternative to the pause() statement. While pause() offers 2 buttons, OK and Cancel, PauseOK() offers just the OK button. It's useful for displaying a message without forcing the user to decide how to respond.

Error Messages

If WinRunner gives you an error message saying a function is undefined, the libarary has not been properly loaded. Don't forget the mandatory first step before calling functions.

If you receive an "RPC Error" message, you'll have to do some sleuthing to determine the cause. In that case, refer to "RPC Errors" in the RunningShoes help file. That page covers a range of possible causes and how to prevent them from recurring.

Finishing Up

At the end of the script, or when you no longer need access to the library, call the script that unloads the DLL.This statement is not required, since WinRunner will unload any loaded DLL when it exits. However, it is good programming practice to do this explicitly in your script: 

call_close "RunningShoesEnd"();

Created 31 October 2005 (yes, it's Halloween!)

Top of  This Page | R. E. Cook Home Page

Copyright R. E. Cook Consulting, 2000 - 2011.
All rights reserved.

The site is designed to look best when viewed with Internet Explorer 5.0 - 8.0. Results with other browsers will probably deviate from what is intended.

NOTE: This website refers to registered trademarks and service marks that are owned by other companies, including Mercury Interactive, WinRunner, TestDirector, TSL, Microsoft, Windows.