Your e-Business Quality Partner eValid™ -- Automated Web Quality Solution
Browser-Based, Client-Side, Functional Testing & Validation,
Load & Performance Tuning, Page Timing, Website Analysis,
and Rich Internet Application Monitoring.

eValid -- Testing Notepad -- Simple Example With Baseline File Checking
eValid Home

Summary
This example script demonstrates eValid interacting with Notepad, a Windows desktop application.

The test plan summary is as follows:

  1. Open a NOTEPAD.EXE instance with a SystemCall command.
  2. Start on THIS page.
  3. Confirm that this is the correct page by highlighting and synchronizing on THIS SELECTED TEXT.
  4. Type a short message into the Notepad window using eValid's "Advanced Recording" modes for desktop and windows application specific options.
  5. Validate that part of the typed-in message [image] is present using a
    Validate -> & Synchronize -> Screen Rectangle
    (or)
    Validate -> & Save -> Screen Rectangle command.

    The & Save choice will create a baseline file during recording and inserts a script command that performs a file-to-file comparison during playback, instead of only the checksum that is generated in the & Synchronize case.

  6. Quit the Notepad instance and discard the typed in material.
  7. Note total time with an ElapsedTime command.

Scenario
The example script below was created using a Windows Vista Home Basic SP1 environment and demonstrates eValid interacting with a version of Notepad only.

Sample Script
Here is a sample script that includes typical instances of these commands, plus screenshots of how they appear on the desktop.

# Recording by eValid V9 
# Recording made on: Microsoft Windows 

ProjectID "Support"
GroupID "Demos"
TestID "baseline_notepad"
LogID "AUTO"

ScreenSize 1280 1024
FontSize 2
DeleteCache
DeleteCookies

# Please make sure that eValid registers your application on the desktop...
SystemCall "notepad.exe"

# The SystemCall goes first to assure that the Notepad winow is really present...
InitLink "http://www.e-valid.com/Products/Documentation.9/Support/" \
         "Desktop/baseline.notepad.html"
Wait 2000
SyncOnText 0 "THIS SELECTED TEXT" ""

#Breakpoint
Delay 2000

# Application Mode ON
Wait 2150
# Please make sure that your window title matches...
DWindowSet 1 "Untitled - Notepad" 154 154 1080 636
Wait 5938
# Included extra top/bottom spacing to avoid conflicts with interactive cursor/margins...
ResetTimer "Start type-in"
KeySys 1 9 0 1
Wait 1692
KeySys 1 13 0 1
Wait 1820
KeySys 1 9 0 1
Wait 5340
KeyText 1 "This is a test"
KeySys 1 13 0 1
Wait 2812
KeySys 1 9 0 1
Wait 5469
KeyText 1 "HELLO WORLD"
KeySys 1 13 0 1
Wait 492
KeySys 1 13 0 1
Wait 540
KeySys 1 13 0 1
Wait 5845

# Make sure that your intended window is in focus before any captures...
xySyncRect 1 212 207 140 52 2287231

Wait 5386

# Make sure that your intended window has focus and provide the baseline
# file named "entry-B.bmp"...

ValidateSavedScreenRect 1 "entry" 212 207 140 52

Wait 4706

# Below is the recorded exit sequence done with the keyboard (not the mouse)...
KeySys 1 70 4 1
Wait 5700
KeyText -1 "x"
KeySys -1 9 0 1
Wait 2380
KeySys -1 13 0 1
Wait 175

# The above sequence eliminates the need for a WindowClose 1, but you
# may need to restore it depending on the system you are using...

# WindowClose 1

ElapsedTime "End type-in"
# End of Script.

Click Here to download the above script so you can try it out in your copy of eValid.

Sample Screenshots
Here are the resulting windows from playback of the above script.

Top Part of This Page
Top Part of This Page

Part to Notepad's Working Area Showing Type-ins Done By Script
Part of Notepad's Working Area Showing Type-ins Done By Script

Validation by CHECKSUM (or) BASELINE vs. RESPONSE files...
Validation by CHECKSUM of image (or) BASELINE vs. RESPONSE files...

BASELINE vs. RESPONSE files...
BASELINE vs. RESPONSE files

Screenshot of Top Part of This Page with Green Screen Playback Summary
Screenshot of Top Part of This Page with Green Screen Playback Summary

Notes

  1. The notepad.exe application will normally reside at ..\Windows\System32\.. by default.
  2. If necessary, please re-map any path differences accordingly. Depending on the version of Notepad that you have you may also need to modify the expected window title in the DWindowSet command.
  3. The value of the checksum in the xySyncRect command is very sensitive to changes in the window during recording. If the recorded value doesn't work the correct procedure is to check the EventLog to determine, at playback time, what the expected checksum value is, and then adjust the script to match that.
  4. The full-screen baseline image is also sensitive to tiny changes, and it is good practice to record the baseline once, then replace the baseline with a current saved screen so that the test passes before release into production.

Cautionary Note
Windows desktops vary significantly and there is a chance that the above script may not play back correctly on your desktop. In that case you may need to re-record the script, using the one above as the pattern, to get all of the desktop geometry data correct.