Get the snapshots of web page using WATiN

This is very good feature added in WATiN tool. By using this we can get the snapshot of the web page where our test cases failed and that snapshot we can store at specify configurable location. Latter we can see the status of web page on failed test cases through snapshot.

Best part is that while sending automated test cases report we can attach failed test cases snapshots also with email to keep clarity about behavior of web page in failed condition.

Below is method to get snapshots of web page:

//Start of method

public void GetSnapshotUsingWatiN()

{

//Specify the location where we want to save all the snapshots.

string location = “c://ruby/”;

//Open new instance of Internet Explorer

IE ie=new IE();

//Go to any specify website

ie.GoTo(http://jawedm.blogspot.com”);

//Capture the snapshot of open web page and save it at mention

location.

ie.CaptureWebPageToFile(location +“/SnapshotUsingWatin.jpg”);

}//end of method.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s