How does WinRunner Work? API Scraping?
User (firstname.lastname@example.org) posted:
Hi All --
Please forgive me if this has been explained ad infinitum (please
point me to the reference if so...I can't find it).
Anyway, I'm curious about how WinRunner actually functions. Is it
just "watching" various W32 API's while running and logging the
various calls it 'intercepts'? I checked the MI site and didn't see
any information on this subject.
Re: How does WinRunner Work? API Scraping?
User Franzen, SPS PROFI, DA (C.Franzen@DeutschePost.de.nospam) posted:
The recorder essentially monitors what messages your AUT receives and
translates this into playback statement.
For checkpoints, the recorder uses WR´s "window property" mechanism to find
the values it records.
The playback system creates windows messages to be sent to the AUT according
to the playback statement and its parameters.
Both playback and recording use a custom synchronization message to find out
whether the AUT is busy or not. This essentially is a dummy event that is
ignored by the AUT. However, WR can see if the AUT has sucessfully ignored
that message/event or not and thus believes to know :-) whether the AUT is
busy or not.
3. Text recognition
In WR 6, the new-style text recognition is rather tricky. AFAIK it traps
certain text-drawing APIs, tells the AUT to redraw the region to be
recognized, and protocols in the hooks what is being drawn. As soon the the
redraw is done, WR undoes the traps and generates/records the text
The old-style recognition is based upon the bitmaps that make up the
characters on-screen and thus relies on the assumption that the font used is
one of the "tought" TTFs, and that the scaling is not non-standard.
WR does NOT (perhaps except in the text recognition area):
o replace system dlls with its own versions (which other test robots might
do, with fatal side-effects and incompatibilities)
o do dirty code patches at run-time.
Instead, the stuff I mentioned uses (mostly) documented Windows API like the
message hook system.
o refer to the standard features that WR has "out-of-the-box", i.e. add-ons
like Web test or Delphi support might work completely differently
o are based upon my own experience and exploration
o consequently are NOT offcicially backed up by Mercury documents (however,
some of the statements have been acknowledged by friendly MI staff members)
o are far from proven, and are totally un-guaranteed :-)
Let me know if that answers your question a bit.
DP AG/Team EPOS-NT
Schwarz, Prof. Spruth & Associates
Unternehmensberatung AG & Co. KG