blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Richard Griffin's Blog

WATiN web recorder++ prototype

I am a big fan of Ruby, Rails and WATiR, but I could not help get excited by WATiN. A lightweight port of WATiR that retains much of the original commands. One of the first challenges was to take a WATiR test and convert this to WATiN, however this was not a challenge, it was a breeze.  With the recent publication of the WATiN mappings I thought that it would be really cool to build a simple web recorder to output C# code that can be easily transferable to either an NUnit or a VS2005 unit test.

The WATiN web recorder is based on the web recorder ++ originally written by Scott Handsleman and Rutger Smit. After hooking up to the sourceforge repository for web recorder++, I got my hands on the code base and started to play. The first bugs to fix were around the marshalling to the UI thread which were causing cross threading exceptions. Once, these were fixed up I moved onto changing the Ruby code to C#, and adding some support for div’s and span’s.
 

 
The WATiN web recorder is still in its infancy and there are a number of areas where I would like to add richer functionality to the User Experience. The use of a web recorder is a two part phase. The first is the recording of the tests that allow the navigation to a particular area, the second stage is the verification that the expected data and HTML elements are located on the page. The verification code is hand crafted and this is where I would like to extend the web recorder so that the verification code can be produced by the tool, helping to save time when creating the tests.

Other functionality that I would like to add :-

  • Currently supports additional HTML elements Spans, Divs, Table Cells, add further support for other elements.
  • Refactor the app so that it runs as an IE Plugin.
  • Playback features needs adding.
  • Refactor the editor to support context sensitive help enhance the interaction.
  • Support for IFrames.
  • Refactor existing architecture into a M-V-C pattern.
  • Create unit tests. 

Download the attachment and unzip the file. The contents include an msi installer for the WATiN Web Reocrder++ prototype.

 

Published 18 October 2006 21:04 by Richard.Griffin
Filed under: ,

Attachment(s): WatinRecorder Setup Lite.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

TrackBack said:

October 20, 2006 23:04
 

TrackBack said:

October 20, 2006 23:04
 

TrackBack said:

October 20, 2006 23:04
 

Richard Griffin's Blog said:

Do you want your tests fixtures to look like this ? [ TestMethod ] public void EnterInvalidUsernameAndPassword()
November 15, 2006 00:35
 

Eden Ridgway's Blog said:

WatiN - A .Net IE Testing Framework

January 11, 2007 04:19
 

Peter McNulty said:

Unfortunately I can't run this to test it.

"EventType : clr20r3     P1 : watinrecorder.exe     P2 : 1.0.2482.35416    

P3 : 45368331     P4 : watinrecorder     P5 : 1.0.2482.35416     P6 : 45368331

P7 : 2f     P8 : 1     P9 : system.io.filenotfoundexception  "

January 21, 2007 18:48
 

Demofox said:

Heya!

I grabbed this and ran it and when i clicked buttons it just put ie.goto's instead of putting in the button click stuff.

kinda wierd, is that how it's supposed to work?

demofox@demofox.org

January 26, 2007 21:25
 

Jay said:

Hey!

I get the same result as Demofox.. nothing but GoTo's

January 29, 2007 10:12
 

Richard.Griffin said:

Hey,

Sorry for not getting back to you sooner.

I have run the app on my box and i am unable to repro the same errors that you are seeing. Please send me your repro steps and I will investigate further.

There is a newer version coming soon which i am going to upload onto openqa.org along with some other goodies.

>Rich.

February 8, 2007 18:48
 

Fatal said:

Hi Richard,

Out of desparation since you seemed to disappear for several months and there was no source code release and the recorder prototype had several bugs / incompatibilities with latest version of Watin, I decompiled the recorder to its source code and fixed a number of bugs locally.

Some of these bugs/enhancements included:

* selecting items in dropdown was outputting outdated watin api code.

* added ability to pass the dropdown text into SelectList method so it can output something like:

it.SelectList(Find.ById("drpItems")).SelectByValue(123); // or .Select("Some Text")

* call ClickDiv / ClickSpan as appropriate (it was calling ClickDiv always)

* add support for text area controls

Those are the main ones i can think of.. If you would like me to send you any of these changes, let me know.

I am eagerly awaiting your upload of a newer version as it would be nice to build a community around the source code - it will get to a mature/usable state much faster :-)

regards,

Paul.

February 8, 2007 23:57
 

chris lester said:

I am hoping you will be posting the source soon, as mentioned by paul it would be great to build a community around this.

Thanks

Chris

February 10, 2007 02:47
 

Frederic Torres said:

Try InCisif.net.

InCisif.net is an automation tool designed to implement client-side functional

testing of web applications under Internet Explorer 6.x or 7.x, using the C#

or VB.NET language with Visual Studio 2003, 2005 or express editions.

Check out our screencasts

February 25, 2007 22:36
 

RV said:

And what about dialog handlers? Unfortinatly I can't use this tool, because I have ConfirmDialogBox where I have to confirm with OKButton. Maybe you can show me how to handle those alerts. Right now Watin cancels all alerts

March 1, 2007 13:00
 

Richard.Griffin said:

March 13, 2007 17:21
 

Alex said:

You can also try SWExplorerAutomation SWEA from <a href="http://webiussoft.com">http://webiussoft.com</a>. SWEA records, replays automation scripts and generates C# or VB.NET script code. SWEA supports all Web browser UI elements: form controls,  frames, windows and html dialogs, popup windows, tables (transformed to DataTable) and more. SWEA was specially designed to automate complex  DHTML/AJAX applications.

March 16, 2007 14:11
 

webQ said:

Hi Richard,

   When I click radio buttons the recorder will get codes as follows:

ie.RadioButton(Find.ByName("the_Name") & Find.ByValue("the_Value"))).click();

But the line does not run well.Cannot fint the radio button.

May i get some suggestions?

Thank U...

May 24, 2007 06:26
 

Channel 9 said:

I would suggest .Net developers use

June 13, 2007 03:23
 

otrack50 said:

How do you extract a table, row, or cell using the recorder? and display the result on the screen?

October 29, 2007 17:15
 

Betsy said:

I am unable to get the Test Recorder to work.  I've tried installing on 3 different machines.  I've tried with IE 6 and IE 7.  No matter what I do, I get this error:

"Test Recorder has encountered a problem and needs to close.  We are sorry for

the inconvience."  I then get an option to Debug or Close the Window.  Debug doesn't show me anything and I can't find any error logs.

March 14, 2008 01:18
 

Ishpreet said:

How do i access a File Download Dialog Box. I want to Click on save file into a location

June 25, 2008 10:32
 

Propecia specifications. said:

Propecia. Buy propecia online. Propecia generic.

July 18, 2008 16:49

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems