# **********************************************************************
# File attachment for qaforums.com
# Section:	WinRunner
# Posting:	http://www.qaforums.com/Forum4/HTML/005245.html
# File Name:	1707006.txt
# **********************************************************************

# Launch Notepad select Edit/Set Font
# select Arial Size 18
# Click the OK Button, Then close the Notepad app...
# this will make 18 the default size...
# At least in my Notepad..

# Tools/GUI Map Editor...
# Close any GUI map by File/Close All...
# Then Learn the Notepad objects for the Main Window and
# the Font Window, answer YES to the question
# Learn all objects within the window...
# The logical name of an object will change depending
# on how you learn the GUI map.  This is one of the largest
# problems when moving a test from one machine to another...
# if you learn the GUI map using the recorder you will have
# different Logical names than if you learn each window
# from the GUI map Editor...

# Make sure the GUI map is loaded and works...
# Check the WinRunner Print Log, all Return Codes
# should be Zero...
# if Not, check and see if the Logical Name in the
# GUI map is different from my test...

# Make sure Notepad is NOT loaded...
rc1 = invoke_application ( "Notepad", "", ".", SW_SHOW );

rc2 = set_window ("Untitled - Notepad", 5);
rc3 = win_activate ("Untitled - Notepad");
rc4 = win_resize ("Untitled - Notepad", 302, 382);
rc5 = win_move ("Untitled - Notepad", 3, 1);
rc6 = set_window ("Untitled - Notepad", 8);
rc7 = win_activate ("Untitled - Notepad");
wait(0,500);
rc8 = menu_select_item ("Edit_1;Set Font...");
rc9 = set_window ("Font", 13);
rc10 = win_activate ("Font");
rc11 = edit_set ("Font:_1", "Arial");
rc12 = type ("<kTab>");
rc13 = wait(1);
rc14 = type ("<kTab>");
rc15 = wait(1);
rc16 = type ("13");
rc17 = wait(2);
rc18 = type ("<kTab>");

printf ( "rc1=%s rc2=%s rc3=%s rc4=%s rc5=%s rc6=%s rc7=%s rc8=%s rc9=%s rc10=%s rc11=%s rc12=%s rc13=%s rc14=%s rc15=%s rc16=%s rc17=%s rc18=%s ", rc1,rc2,rc3,rc4,rc5,rc6,rc7,rc8,rc9,rc10,rc11,rc12,rc13,rc14,rc15,rc16,rc17,rc18 );

# On 5 try's this is what I get
# rc1=0 rc2=0 rc3=0 rc4=0 rc5=0 rc6=0 rc7=0 rc8=0 rc9=0 rc10=0 rc11=0 rc12=0 rc13=0 rc14=0 rc15=0 rc16=0 rc17=0 rc18=0
# rc1=0 rc2=0 rc3=0 rc4=0 rc5=0 rc6=0 rc7=0 rc8=0 rc9=0 rc10=0 rc11=0 rc12=0 rc13=0 rc14=0 rc15=0 rc16=0 rc17=0 rc18=0
# rc1=0 rc2=0 rc3=0 rc4=0 rc5=0 rc6=0 rc7=0 rc8=0 rc9=0 rc10=0 rc11=0 rc12=0 rc13=0 rc14=0 rc15=0 rc16=0 rc17=0 rc18=0
# rc1=0 rc2=0 rc3=0 rc4=0 rc5=0 rc6=0 rc7=0 rc8=0 rc9=0 rc10=0 rc11=0 rc12=0 rc13=0 rc14=0 rc15=0 rc16=0 rc17=0 rc18=0
# rc1=0 rc2=0 rc3=0 rc4=0 rc5=0 rc6=0 rc7=0 rc8=0 rc9=0 rc10=0 rc11=0 rc12=0 rc13=0 rc14=0 rc15=0 rc16=0 rc17=0 rc18=0
# You can see the font size change after teh TAB key is sent...
