Perl Excel to create a test plan with perl — specially very

Today I came across a very interesting problem. I had to write a Test Case document that had quite a huge number of test cases. The interesting part was that the Procedure and the result remained same but the name of the frame and the fields were chaning. I felt that copy/paste and modification would be a complete waste of time, so wrote this perl script quickly. Does what is expected.

#!/usr/bin/perl

#===============================================================================

#

# FILE: gui.pl

#

# USAGE: ./gui.pl

#

# DESCRIPTION: Create excel TC Document using perl.

#

# OPTIONS: —

# REQUIREMENTS: —

# BUGS: —

# NOTES: —

# AUTHOR: Amit Agarwal(amit.agarwal@amit-agarwal.co.in)

# COMPANY:

# VERSION: 1.0

# CREATED: 09/14/2009 06:58:42 PM

# REVISION: —

#===============================================================================

use strict;

use warnings;

use Spreadsheet::WriteExcel;

my $procedure;

my $result;

my $frame;

my $field;

my $line;

my $row = 1;

my $workbook = Spreadsheet::WriteExcel->new(\”amit_agarwal.xls\”);

my $worksheet = $workbook->add_worksheet(\”GUI_TC\”);

# To use blod style, you can use the below format.

# my $bold = $workbook->add_format();

# $bold->set_bold();

# $worksheet->write(5, 0, \”amitag\”, $bold);

# We will assume that file \”amit\” exists in current directory

# and contains two fields per line. First field is frame name

# and second is the name of the field to check.

open(FILE,\”<amit\”)|| die \”Cannot open file amit for input\”;

for $line (<FILE>)

{

my $col = 0;

chomp ($line);

($frame,$field)=split(/,/,$line);

$procedure = \”Objective: Verify the frame $frame\\n\”;

$procedure .= \”Procedure:\\n\”;

$procedure .= \”1. Go to frame $frame\\n\”;

$result = \”1. Verify that the frame ($frame)is displayed correctly.\\n\”;

$result .= \”2. Verify that $field is displayed in $frame\”;

$worksheet->write($row++,$col,\”Verify the frame $frame\”);

$worksheet->write($row,$col++,$procedure);

$worksheet->write($row++,$col,$result);

}

close (FILE);

$workbook->close();

exit;

Play with vim colors.

In vim you can customize the colors of your terminal vim or the GUI version. If you wanted to play around with colors then you can simply put the file containing the colorscheme to directory \”~/.vim/colors\” and load it in vim with \”colorscheme <name>\”.

That most of you would know. What I will add here is how easy it can be create it if you knew the right place to do it: Head over here. No explanations needed. Anyway if you need help, leave a comment.

Update : You can see around all the vim color schemes available at vim.org here:

http://vimcolorschemetest.googlecode.com/

Example screenshot from the page:

\"VIM

Enlightment Desktop.

Enlightenment window managet I just chanced upon today while browsing the list of packages in fedora repository and thought might as well try it for sometime. For sometime now I had shifted to LXDE in favour of its being light weight but was serving well to my purposes and was quite happy with its performance.

So i just installed Enlightenment:

sudo yum install enlightenment

and selected yes for downloading the dependencies to too.  This took me to a great new world of GUI. This is a really great Desktop manager. Seems to be quite okay in terms of using the CPU. The looks are completely configurable. Menus are configurable and if you dont like the default theme then there are lot to choose from at various location some of which I have mentioned in below.

Okay here\’s a screenshot:

\"enlightenment\"

Okay that is not the default theme, but you can get the themes from :

http://linux.maruhn.com/sec/enlightenment-themes.html

http://www1.get-e.org/Themes/E17/

http://themes.freshmeat.net/projects/get-enlightened/

I am really liking the Desktop manager for now and am quite happy to try it out. Earlier to I had tried E16 but did not like that too much 🙁