
“New” day
“New” aims
“New” hopes
“New” plans
“New” efforts
“New” success,
“New” feelings
I wish u a Happy &
very SuccesfuL “NEW DAY”
GOOD MORNING MY DEAR FRIENDS
GoOd MoRnInG My DeAr FrIeNdS
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 6:04 AM 0 comments
Labels: Welcome
Software Test Tools
What Are Software Test Tools?
Software test tools help development teams investigate software bugs, verify functionality, and ensure both the reliability and security of the software they develop. Tools are available for all stages of a software development project. Some software testing tool vendors offer an integrated suite that will support testing and development throughout the life of a project, from gathering requirements to supporting the live system. Other vendors concentrate on a single part of the application development life cycle.
Software Test Tools Business Drivers and Benefits
1) Increase the quality of software applications.
2) Software performance measurement.
3) Improving process management lifecycle of the product.
4) Perform a risk analysis and benchmarking.
5) Gain consistency in testing procedures with automated testing tools (as opposed to manual testing, which may be incompatible).
6) Improving the time to put on the market following the effective detection of functional performance, and security issues.
7) Save money on software development and maintenance costs
Software Test Tools Risks
1. Automated testing can produce quantities of raw data cumbersome. Test for choosing one form tool you can easily manipulate the data that is capable of change and should work together.
2. It undermines the efficiency of fault injection is not important. Fault injection tool specific code paths above weaknesses, particularly, the path that are victims of security attacks can not show through the check.
3. There are two drawbacks you enough for choosing the wrong software tools have not only wasted time and resources, but also an obstacle that you can get your teams made solutions difficult.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 1:13 PM 0 comments
Labels: Software Test Tools
Astro Boy

Theatrical Release:
Friday, October 23, 2009 (Wide; 3,014 theaters)
CAST AND CREW LIST
Directed by:
* David Bowers
Starring:
* Nicolas Cage
* Donald Sutherland
* Freddie Highmore
* Kristen Bell
* Matt Lucas
* Eugene Levy
* Nathan Lane
* Bill Nighy
Screenwriter:
* Timothy Harris
Producer:
* Maryann Garger
Genres:
Adventure Fantasy Sci-Fi Animation
SYNOPSIS
A computer graphics adaptation of Osamu Tezuka's famous manga about a boy robot, first published in 1952.
Set in futuristic Metro City, "Astro Boy" is about a young robot with incredible powers created by a brilliant scientist named Tenma (Nicolas Cage). Powered by positive "blue" energy, Astro Boy (Freddie Highmore) is endowed with super strength, x-ray vision, unbelievable speed and the ability to fly.
Embarking on a journey in search of acceptance, Astro Boy encounters many other colorful characters along the way. Through his adventures, he learns the joys and emotions of being human, and gains the strength to embrace his destiny. Ultimately learning his friends and family are in danger, Astro Boy marshals his awesome super powers and returns to Metro City in a valiant effort to save everything he cares about and to understand what it takes to be a hero.

Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 8:41 AM 0 comments
Labels: New Movie
Nokia's 'Booklet 3G' Netbook

Nokia's 'Booklet 3G' Netbook With 12 Hour Battery-Life. Form and Functionality.
If you're a fan of Netbooks, and also a fan of Nokia, you'll soon be able to indulge your preference. On 2 September 2009, Nokia plans to release availability and pricing details for their new netbook called the "Booklet 3G"
Yes, Nokia is bringing out its own kind of Netbook, and even though it may look like a regular netbook, it will carry the classy, smooth design we're used to see from Nokia.
The Booklet 3G will be Windows based and powered by the popular and efficient Intel Atom processor with a whopping 12 hour battery life. This means people will be able to leave their power cables behind a little more often, without losing connectivity.
Weighing only 1.25 kilograms, this new lightweight plans to pack a significant punch with its highly portable aluminium casing. It's little more than 2 centimetres thick.
Connectivity options include 3G/HSDPA as well as Wi-fi, offering users high speed access to the internet.
The device features a HDMI port enabling HD video out, a built-in camera for video calling, blue tooth and SD card reader. Featuring a 10-inch glass HD ready display and a built-in A-GPS (which works with the Ovi Maps gadget), pinpointing your exact position takes only seconds.
We cannot really be surprised by this move, considering that Nokia is one of the world's leading providers of connectivity. Considering that Nokia is probably one of the most well known names in the world today, consumers should be able to look forward to be able to add to their list of gadgets the new Booklet 3G.
Nokia seems to be upping their game every time a new product is released, and we expect pretty much the same this time. Of course consumer expectations will likely be high with this new addition to their product line, but if Nokia continues to deliver the high quality we've grown accustomed to over the years, I'm sure it will be a hit with users.
Product availability and pricing details will be released on 2 September, 2009 through Nokia World 



Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 8:29 AM 0 comments
Labels: New Technology
What Microhoo means to you

The deal Microsoft and Yahoo made today to combine their ad and search efforts has its roots in the mid-1990s, near the dawn of the Web.
It was then Yahoo CEO Tim Koogle who made the decision that Yahoo would become a “portal,” a gateway to an internal Web world. All the smart guys in New York and in the mainstream media were urging this. Search, they said, was limited, it was techie, it was obscure. The real growth was in media.
Around the same time Microsoft decided it must “embrace and extend” its monopoly from Windows to Office to the Web, through Internet Explorer. Rather than selling what it made, it would bundle its monopoly products with its browser and dominate that way. This led to its antitrust case, and it has embraced, even extended itself into, the legal profession ever since.
So it was mistakes made long ago that created the new Microhoo. Yahoo will become the salesman and public face for Microsoft’s technology. The hope is this will slowly eliminate the technology, legal, and marketing mistakes both are known for, relying on the two firms’ complementary strengths.
For more info...
http://www.smartplanet.com/technology/blog/thinking-tech/what-microhoo-means-to-you/918/?tag=content;col1&gclid=CL73tZ6T0p0CFUtp4wodBnx8sQ
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 8:18 AM 0 comments
Labels: My Readings
Nokia Unveils Its First Linux Phone N900

Nokia unveiled N900, its first smart phone running on Linux software, aiming at improving its offering at the top end of the market.
The Nokia N900 runs on the Linux-based Maeme 5 software, featuring true multitasking with applications as well as Web browsing with Adobe Flash support.
Nokia’s workhorse Symbian operating system controls half of the smartphone market volume — more than its rivals Apple, Research in Motion and Google put together. Nokia said Linux would work well in parallel with Symbian in its high-end product range.
“As Nokia announces the software platform that will drive its future services aspirations it created a dedicated solutions unit — the challenge will be to ensure that all these elements work in harmony in the face of fierce competition from Apple and Google,” said Ben Wood, head of research at CCS Insight.
The new N900 model, with cellular connection, touch screen and slide-out keyboard, will retail for around $712, excluding subsidies and taxes.
Nokia also unveiled a new Solutions business unit, which aims to better tie together its phone operations and new mobile Internet services offering.
Technical details of N900:
Display:
3.5 inch touch-sensitive widescreen display
800 × 480 pixel resolution
Web browsing:
Maemo browser powered by Mozilla technology
Adobe Flash™ 9.4 support
Full screen browsing
Camera:
5 megapixel camera (2584 × 1938 pixels)
Image formats: JPEG
CMOS sensor, Carl Zeiss optics, Tessar lens
3 × digital zoom
Autofocus with assist light and two-stage capture key
Dual LED flash
Full-screen viewfinder
Photo editor on device
TV out (PAL/NTSC) with Nokia Video Connectivity Cable (CA-75U, included in box) or WLAN/UPnP
Landscape (horizontal) orientation
Capture modes: Automatic, portrait, video, macro, landscape, action
Video:
Wide aspect ratio 16:9 (WVGA)
Video recording file format: .mp4; codec: MPEG-4
Video recording at up to 848 × 480 pixels (WVGA) and up to 25fps
Video playback file formats: .mp4, .avi, .wmv, .3gp; codecs: H.264, MPEG-4, Xvid, WMV, H.263
Music and audio playback:
Maemo media player
Music playback file formats: .wav, .mp3, .AAC, .eAAC, .wma, .m4a
Built-in FM transmitter
Ring tones: .wav, .mp3, .AAC, .eAAC, .wma, .m4a
FR, EFR, WCDMA, and GSM AMR
Digital stereo microphone
DLNA
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 9:37 AM 0 comments
Labels: New Technology
A Faster Workstation Means a Faster You

HP Z600 Workstation. Built for professionals like you.
The new HP Z600 Workstation lets you accomplish more with every minute of your time. Spend less time rendering, saving and waiting...spend more time creating. With up to 250%* more speed than your current system, the HP Z600 gives your performance a substantial boost.
• Available with two new-generation powerful intelligent Intel® Xeon® processors, for eight total cores of pure processing power
• Configurable with more RAM and the latest graphics cards to meet the demands of your job
• High-end performance—from one of the smallest, quietest dual-socket workstations available
The HP Z600 is engineered to optimize the way the processor, memory, graphics, OS and software components work together to deliver massive, whole-system computational power. Now you'll have the ability to process more tasks—in less time. The ideal workstation when every inch, watt, and decibel make a difference. 
Designed and pre-configured for professional users
• Powered by the intelligent Intel® Xeon® Processor¹
• Genuine Windows XP Professional 64-bit available through downgrade rights from Windows Vista
Business 64 2
• NVIDIA Quadro NVS 295 (256 MB) graphics card
• 3 GB DDR3 memory
• Dual hard drives (160 GB / 250 GB)
Includes HP LP2275w 22" Widescreen LCD Monitor
$2,063
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 9:12 AM 0 comments
Labels: New Technology
Good Morning
There's
always going to be people that hurt you so what you have to do is keep
on trusting and just be more careful about who you trust next time
around.
GOOD MORNING DEAR FRIENDS...... :) WELCOME ALL OF YOU
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 8:16 AM 0 comments
FIFA Soccer 10 (Xbox 360) Release Date: 10/20/2009

On the pitch, critical gameplay fundamentals have been enhanced to ensure that FIFA 10 mirrors real-world football, providing more sophisticated ball control, and physical interaction between players. In addition, players now move, behave and position themselves more realistically. On attack, players analyze space more effectively, curve their runs in an attempt to stay onside, create passing lanes naturally, and drive for more variety in attacking options. On defense, new concepts like position priority enable defenders to multitask so dangerous spaces left open by teammates out of position are covered. Plus, slide tackle targeting, press marking, and better-urgency clearance logic provide new options that make defending a tactical skill in FIFA 10. In goal, a myriad of improvements and refinements to goalkeeper intelligence result in a more responsive and powerful rushing system and ultra-realistic saves.
Listening to feedback and addressing gamer frustrations has become a key part of the EA SPORTS strategy to improve the FIFA franchise on an annual basis. Better balance on lofted through balls, improved goalkeeper intelligence, more realistic shooting mechanics with less shots hitting the goal posts, a practice arena to perfect skills, and a more immersive football experience through continuous play and quick free kicks are just a few of the issues raised by fans and addressed in FIFA 10.
Three new innovations revealed today have been developed to change the player control experience in FIFA 10. The first-ever true 360° dribbling system gives players finer control of the ball, enabling them to find spaces between defenders that previously were not possible. Using an all-new animation technology, skilled dribblers now have the ability to face the defender and use highly responsive lateral dribbling to skip past him. An innovative concept called Freedom in Physical Play enables players to perform wider dribble touches and new collision sharing creates a varied, less predictable, and extended fight for possession between the dribbler and a defender.
FIFA 10 also features a deeper iteration of the ever-popular Manager Mode with more than 50 major improvements, including new match realism, realistic player transfers based on multiple decision points, and true-to-life player growth curves.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 4:11 PM 0 comments
Install Windows XP after installing Ubuntu
STEP 1
Install UBUNTU in your machine.
STEP 2
Create a partition to install XP.
Now we must create a space on the hard drive for XP, so this means resizing the Ubuntu partition. Restart the system using the Ubuntu Live CD as it gives you access to GNOME Partition Editor. When loading the CD, select "Try Ubuntu without any change to your computer.
Right-click on the main data partition which has been formatted with ext3 - it should be /dev/sda1 - and select "Resize/Move"
Move the cursor to the right to reduce the ext3 partition and create free space on the hard drive, which will take the XP NTFS partition. Make sure the space is large enough to hold XP (at least 2 GB - preferably 5 Go). Then click "Resize / Move" to confirm the selection, and "Apply" to return to the main screen to make the change under-way.
STEP 3
Install Windows XP to Your Machine.
STEP 4
Restore the GRUB boot loader
Once XP has been installed, it will boot happily into XP but there's no sign of Ubuntu. To reinstate GRUB as the system bootloader it needs to be reinstalled into the MBR.
Boot the system from the Ubuntu Live CD and select "Try Ubuntu without any change to your computer".
To enter the GRUB configuration mode, type in "sudo grub" and press Enter. Then type in the following commands in sequence:
- root (hd0,0)
- setup (hd0)
- quit
- exit
STEP 5
Change the menu.lst file in /boot/grub directory.
Go to the grub directly using terminal then type sudo nano menu.lst.
then Edit it as follows and save the file.
Scroll down to the bottom of the file and type in the following text strings:
title Windows XP
root (hd0,1)
makeactive
chainloader +1
Save the file and reboot. When the GRUB loader launches hit ESC for the boot menu. Windows XP is the last option - select it and XP will load.
If you want to make the GRUB menu always available, boot back into Ubuntu and edit the MENU.LST file. Find the hiddenmenu text string and change it to #hiddenmenu.
To increase the menu timeout, change the default timeout 3 to something more appropriate.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 3:41 PM 0 comments
Ong Bak 2: The Beginning

Release Date: October 23, 2009 (limited)
Studio: Magnet Releasing (Magnolia Pictures)
Director: Tony Jaa
Screenwriter: Panna Rittikrai
Starring: Tony Jaa, Sorapong Chatree, Sarunyu Wongkrachang, Nirut Sirichanya, Santisuk Promsiri, Primorata Dejudom
Genre: Action
MPAA Rating: R (for sequences of violence)
Official Website: OngBakTwo.com
Review: Not Available
DVD Review: Not Available
DVD: Not Available
Plot Summary: Set in the regal times of King Naresuan, Tien (Tony Jaa) is a man who was born into nobility but had it stripped from him after his parents were brutally murdered. During his childhood Tien learned Khon, a form of dance which is usually reserved for royalty. Although he didn't know it yet, Khon would later prove to be an invaluable aide to him. After seeing his parents murdered at the tender age of 10, Tien is forced to live on the streets where he is eventually captured by a group of thieves who take him in and teach him how to steal and fight.
Tien's expertise as a thief and fighter grows and it isn't long before he is made head thief. Then Tien sees something that makes his stomach churn. A competition is being held to find the best knights to serve under the very man who had killed Tien's parents all those years ago. Tien passes the tests easily and is made Lord Rachasana's 2nd Knight. Now, he has his opportunity to strike but he will have to use all his skill and ingenuity if he is going to get his revenge on the man who killed his parents.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 9:13 AM 0 comments
Welcome to My Blog
Past is Experience!
Present is Experiment!
Future is Expectation!
Use ur Experience!
In ur Experiment!
To achieve ur Expectation!
WELCOME ALL OF YOU MY FRIENDS......
मेरे दोस्तों का स्वागत...
bienvenue à mes amis
私の友人を歓迎
내 친구 오신 것을 환영합니다
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 8:39 AM 0 comments
The Vampire's Assistant

Synopsis
Based on the popular series of books by Darren Shan, Cirque du Freak: The Vampire's Assistant tells the story of a small-town teen who inadvertently shatters a 200-year-old truce between warring factions of vampires. Sixteen-year-old Darren (Chris Massoglia) is your typical adolescent; he spends most of his time with his best friend, Steve (Josh Hutcherson), earns decent grades, and generally manages to stay out of trouble. But trouble finds Darren when he and Steve make the acquaintance of a vampire named Larten Crepsley (John C. Reilly) while attending a traveling freak show at a local theater. Transformed into a bloodsucker by Crepsley, Darren joins the Cirque du Freak and quickly ingratiates himself with the unusual cast of characters who populate it, including Madame Truska the Bearded Lady (Salma Hayek) and the traveling sideshow's towering barker (Ken Watanabe). As Darren works to master his newfound powers as a budding member of the supernatural underworld, he becomes a valued pawn between the vampires and their deadlier rivals, the Vampanese. With tensions between the two sects intensifying, Darren must figure out a means of keeping the coming war from destroying his last vestige of humanity. Patrick Fugit, Orlando Jones, Willem Dafoe, and Jane Krakowski co-star. - Jason Buchanan, All Movie Guide
Movie Info
Starring:John C. Reilly, Ken Watanabe, Josh Hutcherson, Chris Massoglia, Ray Stevenson
Theatrical Release Date:10/23/2009
Rating:PG-13
Run Time:108 min.
Distributor(s):Universal
Director(s):Paul Weitz
Genre(s):Action, Family, Fantasy
Themes:Vampires, Metamorphosis
Tone:Humorous, Stylized
Country of Origin:USA (10-23-2009)
Language:English

Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 5:07 PM 0 comments
Test Automation
Test automation is the use of software for monitoring the performance tests, comparing actual results with expected results, the functions of setting up test conditions and control tests and other testing Reference [1]. Generally, test automation involves automating a manual process already in place that uses a formalized testing process.
Following two pictures are describing the test automation steps. 

Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 3:34 PM 0 comments
Cucumber and Ruby on Rails (Part 6) My learning materials
OK now I think you all have good knowledge about my pasts posts. I f you have any question you can ask me any time by mailing me. Now lets move to our todays lesson.
What can we do further with our project. Hmmmmm... We can validate user inputs . Lets see how can the validations can be done using cucumber.
What can we validate. We can validate “user inputs are OK such as is price is a numerical value or not and all the fields are not empty etc..”
Before doing the cucumber part lets see the what is happening in GUI part.
Go to the product/app/models/ folder and open product.rb file. Afetr that copy and paste following codes to it as follows.
class Product < ActiveRecord::Base
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
end
Now lets see the GUI.
1)First go to the product folder in the terminal and then run the server “ruby script/server”
2) Then gotothe browser and type “http://localhost:3000/products” . Then you can see following GUI
3)click on New product link and you can see this page.
4)Now check what is happening when click on create button without filling any field. You can see following error massages.
5)Now you can see what is happening when there is one field is filling and click create button. Check them with your self.
6)Now lets see how the cucumber can use for this.
7)Go to the feature folder and create a new file called validate_product_details.feature and copy and paste following scenario.
8)
Scenario: Validate Product Details
Given I have no products
And I am on the list of Products
When I follow "New Product"
And I fill in "Title" with ""
And I fill in "Description" with ""
And I fill in "Image Url" with ""
And I fill in "Price" with ""
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
9)Now run the cucumber features/validate_product_details.feature then you can see following.
10)It says all steps are passed. In this scenario we can check alll the validation by writing steps like follows
Scenario: Validate Product Details
Given I have no products
And I am on the list of Products
When I follow "New Product"
And I fill in "Title" with ""
And I fill in "Description" with ""
And I fill in "Image Url" with ""
And I fill in "Price" with ""
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
When I fill in "Title" with "C#"
And I fill in "Description" with ""
And I fill in "Image Url" with ""
And I fill in "Price" with ""
And I press "Create"
Then I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
When I fill in "Title" with "C#"
And I fill in "Description" with ""
And I fill in "Image Url" with ""
And I fill in "Price" with "23"
And I press "Create"
Then I should see "Description can't be blank"
And I should see "Image url can't be blank"
When I fill in "Title" with "C#" .......
like wise we can write so many steps.
11)But you can see that is not much effective because write all the validation like this is not good. What can we do for it. Think a little bit....
12)If you can remember the last post why we can't use that. Then the above scenario can be written as follows.
Scenario: Validate Product Details
Given I have no products
And I am on the list of Products
When I follow "New Product"
When I fill in the following:
| Title | |
| Description | |
| Image Url | |
| Price | |
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
13)Now run the cucumber features/validate_product_details.feature
href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaQD7rNpHoYBhgzg21XQiHOEH_8Jh02dNuAdP0oKgQBuNYlolS3o01DToXvYZ3QdZIj_HiUdi5RtfodqhQLnUXivHK4TiiWY3fuRYCIqvfi0SIGn6X5UacXBI-qvxxAgK5XghdRY7HIXQ/s1600-h/5.png">
14)What a simple way to write validation file. Now lets expand this as follows and try to understand to what is happening there.
Scenario: Validate Product Details
Given I have no products
And I am on the list of Products
When I follow "New Product"
When I fill in the following:
| Title | |
| Description | |
| Image Url | |
| Price | |
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
When I fill in the following:
| Title | |
| Description | |
| Image Url | |
| Price | 20 |
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Image url can't be blank"
When I fill in the following:
| Title | |
| Description | |
| Image Url | a.jpg |
| Price | |
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Description can't be blank"
And I should see "Price is not a number"
When I fill in the following:
| Title | |
| Description | My name is JTK |
| Image Url | |
| Price | |
And I press "Create"
Then I should see "Title can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
When I fill in the following:
| Title | JTK |
| Description | |
| Image Url | |
| Price | |
And I press "Create"
Then I should see "Description can't be blank"
And I should see "Image url can't be blank"
And I should see "Price is not a number"
15)Now run the cucumber features/validate_product_details.feature now try to write your own validation files for your projects.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 12:54 PM 0 comments
Under construction
Hi all,
These days I am going too change my blog view to different view. So sorry for problems which you found.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 5:18 PM 0 comments
Cucumber and Ruby on Rails (Part 5) My learning materials
OK now I think you have a good idea of my past posts. Pardon me because my new post is late. As I said earlier there is a simple way of the last scenario. First we look at that scenario.
Scenario: Create Valid Product
Given I have no products
And I am on the list of Products
When I follow "New Product"
And I fill in "Title" with "Ruby On Rails"
And I fill in "Description" with "Model View Control Architecture"
And I fill in "Image Url" with "ror.jpg"
And I fill in "Price" with "22"
And I press "Create"
Then I should see "Product was successfully created."
And I should see "Ruby On Rails"
And I should see "Model View Control Architecture"
And I should see "ror.jpg"
And I should see "22"
And I should have 1 product
In this scenario we used “I fill in “(field name)” with “(value)” ” lot of time. But we can give this in a simple way. Lets look at that scenario.
Scenario: Create Valid Product
Given I have no products
And I am on the list of Products
When I follow "New Product"
When I fill in the following:
| Title | C# |
| Description | ABC |
| Image Url | c.jpg |
| Price | 5 |
And I press "Create"
Then I should see "Product was successfully created."
And I should see "C#"
And I should see "ABC"
And I should see "C#"
And I should see "5"
And I should have 1 product
When we write this what is happening. Go to your webrat_step.rb file and you can see the following step definition.
# Use this to fill in an entire form with data from a table. Example:
#
# When I fill in the following:
# | Account Number | 5002 |
# | Expiry date | 2009-11-01|
# | Note | Nice guy |
# | Wants Email? | |
#
# TODO: Add support for checkbox, select og option
# based on naming conventions.
#
When /^I fill in the following:$/ do |fields|
fields.rows_hash.each do |name, value|
When %{I fill in "#{name}" with "#{value}"}
end
end
There you can see the the cucumber give a easy way to do our job without typing same thing several times like in the 1st scenario.
What is happening from this step definition is it created a step for us by getting the values in table. How it does lets look at step by step.
When /^I fill in the following:$/ do |fields|
From this it takes the one field of the raw for a example | Title | C# |
fields.rows_hash.each do |name, value|
From this it takes the values of the field as name and value then
name= Title
value=c#
When %{I fill in "#{name}" with "#{value}"}
From this step its create a step using that value then the step comes as
When I fill in Title with C#
and end like wise all the fields are translated by the cucumber.
Then what happen. Now it check this new step with the webrat file or with our step definition file and go through it.
The correct step definition is
When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
fill_in(field, :with => value)
end
When we run this scenario using cucumber features/create_product.feature we got as follows.
it says all the steps are pass. that means code is OK. see how the cucumber is easy to work. according to that you can type these steps as table in that scenario
Then I should see "Product was successfully created."
And I should see "C#"
And I should see "ABC"
And I should see "C#"
And I should see "5"
try it your self.
Best Regards,
Jeewantha.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 9:42 AM 1 comments
Cucumber and Ruby on Rails (Part 4) My learning materials
I think you get a good knowledge from my past posts. OK now lets see to test adding new products. Before that lets see what is happening when new product is adding.
1)He should be in the List of Product page as follows.
2)Now what he do . He clicks the New Products Link. Now he can see the following page.
3)Now he fill the fields as
Title = Ruby On Rails
Description = Model View Control Architecture
Image url= ror.jpg
Price=22
4)Now he clicks Create button and he can see following page.
5)He can see “Product was successfully created” and he can see “Ruby On Rails”, “Model View Control Architecture”, “ror.jpg” and “22”.
6)Now lets see how we can test it using Cucumber Testing.
7)Create a new file called “create_product.feature” in product/features folder and paste this scenario.
Scenario: Create Valid Product
Given I have no products
And I am on the list of Products
When I follow "New Product"
And I fill in "Title" with "Ruby On Rails"
And I fill in "Description" with "Model View Control Architecture"
And I fill in "Image Url" with "ror.jpg"
And I fill in "Price" with "22"
And I press "Create"
Then I should see "Product was successfully created."
And I should see "Ruby On Rails"
And I should see "Model View Control Architecture"
And I should see "ror.jpg"
And I should see "22"
And I should have 1 product
8)This scenario check all the steps which I shown above. Check them your self. Now go to the "Product_steps.rb"page in features/step_definition folder and paste following codes.
Given /^I have no products$/ do
Product.delete_all
end
Then /^I should have ([0-9]+) product$/ do |count|
Product.count.should == count.to_i
end
9)Now we have 2 feature files as list_of_product.feature and create_product.feature
10)when we run cucumber features all the features files are run. If we want to run only one file we can run cucumber features/(file name)
eg:- cucumber features/ create_product.feature
11)Run the cucumber features/ create_product.feature and you can see following.
12)It says all the steps are passed. Now you can test to verify actually this scenario works with the code for that we can change some codes in scenario and check running cucumber features.
13)I give it to you as a home work. Check what happening when the scenario change and run cucumber features.
14)Lets see in the next post how this scenario can be written in simple way.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 10:31 AM 1 comments
Cucumber and Ruby on Rails (Part 3) My learning materials
Now lets start to create scenarios and do testing using cucumber
1)Lets create our first scenario as follows and save it in the product/features folder as named
list_of_product.feature
Scenario: Products List
Given I have products titled Java, description Platform Independent, Image url java.jpg, Price 20
When I go to the list of Products
Then I should see "Java"
And I should see "Platform Independent"
And I should see "java.jpg"
And I should see "20"
2)Now run the cucumber features and see the out put as
3)You get 1 scenario (1 undefined)
6 steps (5 skipped, 1 undefined)
that means your 1st step is not defined. That means the cucumber do not know how to deal with the step
GivenI have products titled Java, description Platform Independent, Image url java.jpg, Price 20
To deal with this that should be in the webrat_step.rb file in the features/step_definitions folder. If not we have to create them for the use of cucumber and you can see the cucumber suggest you some definitions as
Given /^I have products titled Java, description Platform Independent, Image url java\.jpg, Price 20$/ do
pending
end
4)Now lets create the definition file. Create a file named product_step.rb file in the features/step_definitions folder and paste the following code there and save it.
Given /^I have products titled (.+), description (.+), Image url (.+), Price (.+)$/ do |title,description,image_url,price|
Product.create!(:title => title, :description => description, :image_url => image_url, :price => price)
end
In this step it says to store the data in the table called Product.
5)Now lets run again cucumber features and see the result. You can see following error.
This says there is no such a constant like Product. This means still we do not create our Product Table lets create our product table. Type on the terminal as follows.
ruby script/generate scaffold product title:string description:text image_url:string price:decimal
rake db:migrate
6)Now lets run again cucumber features
That says that product_test.products table. That because these scenarios working with the tables in the test database. So lets fix it. Run following code.
rake db:test:clone
Now lets run again cucumber features.
7)Its hows the following error and add it to the file path.rb in features/support
this should come after case statement
when /the list of Products/
products_path
the reason for this is (
We have our first passing step! The second step is now failing, though. This is because Cucumber doesn’t know how to translate “the list of articles” into a path in our application.
One of the files installed by Cucumber is called paths.rb, which lives in the /features/support directory. In this file we can define custom paths that map the English definitions in Cucumber files to paths in our Rails application. To add a mapping we just add a new when condition to the case statement in the path_to method. (There’s a comment in the file to show us where to add it.)
)
8)Now run again cucumber features 
9)You get all the scenarios are passed.
10)Now our first scenario is passed lets try another scenario in the next post. Try this scenario and check you can understand it. Copy and paste to the same feature file
Scenario: Products List
Given I have products titled Java, description Platform Independent, Image url java.jpg, Price 20
And I have products titled Ruby on Rails, description Rich internet Application, Image url ror.gif, Price 25
When I go to the list of Products
Then I should see "Java"
And I should see "Platform Independent"
And I should see "java.jpg"
And I should see "20"
Then I should see "Ruby on Rails"
And I should see "Rich internet Application"
And I should see "ror.gif"
And I should see "25"
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 3:29 PM 2 comments
Ruby cucumber Part3
Hi all,
I am very sorry for the delay of my 3rd post because these days are i am very busy. i hope to do it as soon as possible. Most probably today afternoon i can do it.
Cheers,
jeewantha.
Posted by ජීවන්ත තාරක (Jeewantha Tharaka Kodikara) at 12:11 PM 0 comments
