This func should be called from a funtion like FRM_set_window();
before or after the the changes will made
######################################
public function capture_Window(in wins)
{
auto previousSearchpath;
extern Project_Path;
previousSearchpath = getvar("searchpath");
### here should be the new path to the script "capture_bitmap"
setvar("searchpath", Project_Path & "\\..\\");
call capture_bitmap(wins);
setvar("searchpath", previousSearchpath);
}
######################################################################
### Start of capture_Bitmap ###
### This script is to take a picture of the window that is active.
### When calling this script it has to be insured that the
### window to be captured ###
### is not minimized. ###
### ###
### Author: Carsten Büche Date:06.12.06 ###
### in : window ###
### out : rc ###
######################################################################
###########
string_to_set="";
string_to_set1="";
string_to_set2="";
string_to_set3="";
count_of_strings_from_date="";
string_from_date="";
i="";
rc="";
string_from_date=( get_time ());
string_from_date=time_str (string_from_date);
count_of_strings_from_date=split(string_from_date,string_part1," ");
for(i=1;i<=count_of_strings_from_date;i++)
string_to_set1=string_to_set1 & string_part1[i]& "_";
count_of_strings_from_date=split(string_to_set1,string_part2,":");
for(i=1;i<=count_of_strings_from_date;i++)
string_to_set2=string_to_set2 & string_part2[i]& "_";
count_of_strings_from_window=split(window,string_part3,"/");
for(i=1;i<=count_of_strings_from_window;i++)
string_to_set3=string_to_set3 & string_part3[i]& "_";
# Activate the window that shall be captured if possible (i.e. if it
is enabled) - this ensures that the
# WinRunner window doesn't hide parts of the screen that shall be
captured.
rc = win_get_info(window, "enabled", windowIsEnabled);
if(windowIsEnabled)
rc += win_activate(window);
if(count_of_strings_from_window > 1)
{
string_to_set=string_to_set2 & string_to_set3;
}
else
string_to_set=string_to_set2 & window;
# Take the screenshot.
rc += win_capture_bitmap("screen_shot_of_window_on_date_" &
string_to_set, window);
# Document the action in test results.
tl_step("Screen_shot was made from", rc, "Window with logical
description in Gui_map: \"" & window & "\"");
treturn rc;
######################################################################
### END of capture_Bitmap ###
######################################################################
# This sequence deletes all Bitmaps captured from previos runnings.
dos_system("del " & Project_Path & .bmp /S /F /Q");