R. E. Cook
RunningShoes Library for WinRunner
Custom WinRunner Functions
and Utilities, to Your Specs
A Random Collection of WinRunner Solutions
Creating DLLs for WinRunner
(Mercury Interactive's Worldwide Users Conference 2000)
R. E. Cook
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.
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.
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
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
## Find and display information about the local PC.
pc = ComputerName();
user = UserName();
title = "PC Information";
message = "Computer: " & pc & ", Username: " &
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
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.
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.
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:
Created 31 October 2005 (yes, it's Halloween!)