Search the web
Sign In
New User? Sign Up
EMOS_framework
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
A solution to capture bitmap during testrun with timestamp and resu   Message List  
Reply | Forward Message #212 of 238 |
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");



Tue Mar 13, 2007 8:56 am

cbueche
Offline Offline
Send Email Send Email

Forward
Message #212 of 238 |
Expand Messages Author Sort by Date

This func should be called from a funtion like FRM_set_window(); before or after the the changes will made ###################################### public...
Carsten Büche
cbueche
Offline Send Email
Mar 13, 2007
9:03 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help