First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« HttpOnly Cookies on ASP.NET 1.1 | Main | DasBlog 1.8 will/does produce Atom 1.0 v... »

Watirmaker01Well, my wife is out of town and as usual, I can't sleep at all. We've been married 5 years and we just can't sleep separate. This is both a good and a bad thing. Bad because it's 3:23am, good because I felt compelled to write some software.

I've been digging Watir lately and have introduced it around work. The question that everyone keeps asking is "ok, so how do I automatically record Watir scripts" and the answer has been, to the best of my knowledge, "um, you don't. Hopefully someone will do something soon."

I got tired of waiting. I started at 10pm and now it's 3:25 and Conan is being repeated. So, here's a screencast of my results after 5.5 hours. It's very rough but it supports text boxes, buttons, links, select lists (kinda), radios and checkboxes. It doesn't support frames, iframes, the back button, divs, tables, etc yet. It's also very sloppy code, so I think what I'm going to do is get a few volunteers in the Watir community who are also .NET savvy to help me out and I'll try to release it in a week or so.

There's some really crazy stuff going on in here with UCOMIConnectionPoint in order to get "IE on a string." Also, a lot of things are being caught on the onfocusout event. I also need to understand if HTMLDocumentEvents2 is the right object model to be watching.

If there's interest, we shall see. Interested? Here's the screencast of WatirMaker 0.1. I'm off to bed.

Tracked by:
"WaterMaker - GUI Recording for Watir" (Captain LoadTest) [Trackback]
"MCE Webguide for Media Center 2005" (The Cerebral Kitchen) [Trackback]
"WatirMaker Version 0.01 Source" (ComputerZen.com - Scott Hanselman's Weblog) [Trackback]
"Been a while, but I'm not done yet.." (Tony Semana @ Semantechs Guy) [Trackback]
"The Latest In The World Of JavaScript - "AJAX, Web 2.0 and the World Of Tomorro... [Trackback]
"re: It's gettin' awful lazy in here" (Outta My Mind...) [Trackback]
"My Year In Blogging - 2005" (ComputerZen.com - Scott Hanselman) [Trackback]
"OnTurning0x20AndLookingBackArt2005" (ComputerZen.com - Scott Hanselman) [Trackback]
"Automating Web UI testing with SWEA, C#, & NUnit (part 1)" (QA Insight - Thoug... [Trackback]
"Taking the Ruby and Watir Plunge" (TonyB) [Trackback]
"New Release of WatirMaker now WatirRecorder" (Scott Hanselman's Computer Zen) [Trackback]


Wednesday, July 27, 2005 3:50:37 AM (Pacific Standard Time, UTC-08:00)
Very cool.

Your post 'Integrating Ruby and Watir with NUnit' is what put me onto Watir (thanks by the way): In a weird confluence of events, your post came out, I got involved as a reviewer for a scripting for testers book (I didn’t know initially but the book features Ruby as the scripting language), and I was also watching the Rails media wave. This trinity got me to play with Watir – and got hooked – as well as Rails. Ruby quite rocks.

At that time I had Selenium running our GUI tests but found some shortcomings on that tool specific to the way my company required us to work.

We're in mid-switch on a major release, running old tests with selenium and writing new ones with Watir and converting the old ones when they break. This type of recording feature would make a solid option even better.

Definitely hope to see this come to pass.
Tony
Wednesday, July 27, 2005 6:40:31 AM (Pacific Standard Time, UTC-08:00)
The yellow highlighting in the browser during playback is sweet.
Wednesday, July 27, 2005 7:14:42 AM (Pacific Standard Time, UTC-08:00)
Thats pretty damn cool.
One question, (and completely offtopic) what the calendar on your desktop?
Patrick
Wednesday, July 27, 2005 8:25:38 AM (Pacific Standard Time, UTC-08:00)
Nice work Scott. I can never sleep away from my wife either. How long did you say you spent writing this? I keep trying to convince the testers at work to ditch commercial-gui-automated-testing-tool-that-makes-you-use-VBA-for-automation for something like this.
Wednesday, July 27, 2005 9:20:16 AM (Pacific Standard Time, UTC-08:00)
The calendar on my desktop is the InkDesk stuff that comes with the TabletPC Experience Pack

I sent 5.5 hours on it. Believe me, the code is ALL f'ed up, but it works to "sketch" a site.
Scott Hanselman
Wednesday, July 27, 2005 10:25:38 PM (Pacific Standard Time, UTC-08:00)
Very interested, Scott. I have been working with similar tools for SAMIE and Perl's Win23::GUITest.

BTW, Jason, I think the yellow flashing you talk about is Watir functionality.
Thursday, July 28, 2005 1:20:21 AM (Pacific Standard Time, UTC-08:00)
Hi Scott,

This is great work! Your original Watir post got me thinking about how you could use Watir to drive the automation of IE, but perform your assertions in .NET.

My idea was to use Ruby simply as the automation engine – you’d call your scripts using a .NET wrapper, pass back the contents of the final HTML document via the process.StandardOutput, then use the HTML Agility Pack (see http:// blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx and http:// smourier.blogspot.com/) to load the document and then perform XPath queries (built using a tool like http:// www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=4f976e6e-9474-4813-b1cd-5e565f3219f9) against the HTML DOM to validate that the HTML elements are in the correct state (using Assert.IsTrue etc) rather than having to write the assertions in Ruby then use regular expressions to parse the output.

Unfortunately I’m totally maxed out working on a Scrum Methodology plug-in for Team System and have absolutely zero time to get this working…
Friday, July 29, 2005 11:51:02 PM (Pacific Standard Time, UTC-08:00)
Hi Scott,

How come few of ur icons(shorcuts) showing Firefox's ICON in ur desktop???/

Thursday, August 04, 2005 12:19:32 AM (Pacific Standard Time, UTC-08:00)
Great, the ideas always become programs to high hours of the dawn...
Carlos.
Wednesday, August 24, 2005 10:06:21 AM (Pacific Standard Time, UTC-08:00)
Been waiting and thinking of making something like this for Watir for quite sometime now. Your code gives me a huge jump in this regard. Best of all, its in C#. Buhahhahaha, lovely!


Gotta extend it... I hope there is no restriction on modifying the code for non-commercial reasons to speed up writing scripts process?
Comments are closed.

Contact

Sponsors

On this page...

Tags

Calendar

<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Archives

Google Ads