User George Ramsdell ( posted:

Content-Type: multipart/alternative;

Content-Type: text/plain;

Subject: How to work with COM objects.

Hi Gary,
Here is the sample:

Working with COM objects
This is not a standard feature of WinRunner, is not guaranteed to work
and is not supported by Mercury Interactive Technical Support.
The TSL COM support library allows you to access COM server processes
through TSL. In-process COM servers cannot be accessed this way. For OCX
and ActiveX support, please use the ActiveX add-in of WinRunner.
To load the library for use with WinRunner:
1. Unzip the attached file into a temporary directory.
2. Copy the comSupport.dll file from the DLL folder in the temporary
directory to the \arch directory in your WinRunner installation
3. Copy the cominit and comlib folders from the scripts folder in the
temporary directory to the \lib directory in your WinRunner installation
4. Add the following line to the end of your startup script or the
tslinit script, which is located in the WinRunner\dat directory.
call cominit();
With this DLL you can activate methods as well as get and set values of
properties in a COM object. Reference to the COM object is by ProgID. If
working with Visual Basic DLLs the ProgID is <project name>.<class
Please refer to the COMReadme.txt file for information on the functions.

The DLL containing the COM object must be registered.
The development code for the library is attached in the
# Start a new Word session.
# NOTE: This test will only work with Word version 8 (i.e., Word 97).
load_com( "word.application", wordHandle);
# When started up by COM, Word is not visible.
com_get_property( wordHandle, "Visible", value);
pause( value);
# Display Word.
com_set_property( wordHandle, "Visible", "True");
# Get the name.
com_get_property( wordHandle, "Name", value);
pause( value);
# Resize Word.
p1 = 250;
p2 = 250;
com_activate_method( wordHandle, "Resize", value, p1, p2);
pause ();
# Open the COM object handling the documents displayed inside Word.
rc = com_get_property( wordHandle, "Documents", docsHandle);
# Open a new document.
doc = getvar( "testname") & "\\sample.doc";
com_activate_method( docsHandle, "Add", value);
rc = com_activate_method( docsHandle, "Open", value, doc);
# Enter text.
com_get_property( wordHandle, "Selection", selHandle);
text = "text entered through com";
com_activate_method( selHandle, "TypeText", value, text);
com_activate_method( selHandle, "TypeText", value, doc);
# Select the first 10 characters.
com_set_property( selHandle, "Start", "1");
com_set_property( selHandle, "End", "10");
unload_com( selHandle); <<>> <<>>
unload_com( docsHandle);
unload_com( wordHandle);


Our Award Winning Customer Support Web Site offers many features and
extensive information that will help you to be more successful with MIC
solutions. Register today!

Thousands of known problems/questions and their solutions are available
in the
online Customer Support Knowledge Base. You can quickly find answers
your questions, or solve problems even before you encounter them.

Customers need not wait on hold to get technical assistance. Technical
questions for customer support can be submitted, tracked and updated
any hour of the day from the Customer Support Web Site.

Customers will receive quick and accurate answers to questions by asking

the online customer support User Discussion Forums. Thousands of
experienced users frequent these forums and answer questions regularly.

Customer Satisfaction is very important to us. If you are not satisfied
with any
of our support services, please let us know by calling (408) 822-5400 or

sending e-mail to

Thank You,

Mercury Interactive Customer Support

Mercury Interactive Corporation Tel: (408)822-5306
1325 Borregas Avenue Fax: (408)822-5316
Sunnyvale, California 94089
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
< !-- |**|begin egp html banner|**| -->