R. E. Cook
Home 
Contact Us 

Dr. Cook
Resume 

RunningShoes Library for WinRunner 
RunningShoes 

Custom WinRunner Functions 
and Utilities,
to Your Specs
Custom 

A Random Collection of WinRunner Solutions
Solutions 

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

R. E. Cook Consulting

 


A Random Collection of TSL Solutions


This is just a small collection of functions and other suggestions. Most of these originated as my replies to questions on other WinRunner discussion boards or from the classes I teach.

The code for most examples is displayed as a small text file to avoid the format mangling that browsers tend to do to normal pages (lines wrap, indents disappear, and the resulting code is unreadable). You can copy and paste easily from these text files.

Array contains an element? Determine whether an element is in an array. 7/6/2002

Batch file to capture an executable's return value. TSL's invoke_application() won't give it to you.

Conditionally calling an initialization script A simple bit of code ensures that an init script will always be called for a test script regardless of whether the test is called from a driver script 10/25/05.

Character from its ascii code Generate a character if you know its ascii value. 2/9/00

Data table entries containing WinRunner constants How to use defined constant names (e.g., "TRUE") in the data table and have WinRunner convert them to their defined values. 7/6/2002 

Data table problem cell entries Cell entries that are changed by Excel or the Data Table editor 7/13/02.

Extern (DLL) functions and strings Strings passed into or out of extern functions are subject to several undocumented constraints on their size. Violating those constraints causes RPC errors. 12/27/02

Get text by sending a Windows message. The process SOMETIMES works when obj_get_text() fails. Can be effective with VC++ (Afx...) objects. 2/21/02

Header control on a SysListView32 list control. How to click the column headers to sort the columns. The technique might be adaptable to a variety of other controls.

Index of a specified occurrence of a character in a string 6/17/01

Integer portion of any input value Correct the error generated by TSL's int(-x). 2/21/00

Looping infinitely for() vs. while() statements 5/20/00

Parallel tests on 2 PCs with a single test result Extend the "Synchronize tests on 2 PCs" process to include all of the results from both PCs in a single test result.

RPC Errors What they are and how to avoid and (sometimes) recover from them. 12/27/02

Send repeated keystrokes to the AUT  6/9/2000

Stop a test run from within a function Wish you could use texit in a function? Here's how you can.

Synchronize tests on 2 PCs How to use the Windows API and an ini file to enable communication between the PCs. 5/18/00

WinRunner configuration values Reading from wrun.ini.

WinRunner version at runtime How to determine the version of WinRunner from within a script. 


Updated 25 October 2005



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.