Web Testing with Ruby


//RubyWebDialogsSun May 29 2005 08:02 AM GMT
Describe RubyWebDialogs here.
 
 
//WaTiRArticlesSun May 29 2005 08:02 AM GMT

Watir in Publications


The Watir Project Announcement Bret Pettichord's blog

Watir Project Announcement Brian Marick's blog

Web Browser Testing using Ruby and OLE describes the technology that Watir uses. Jonathan Kohl's blog

Browser-Based Testing Survey *Requires subscription Open Testware Review that compares Samie and Watir

Gathering Performance Information While Executing Everyday Automated Tests Michael Kelly on InformIT



 
 
//WaTiRRequestsSun May 29 2005 08:02 AM GMT
We can use this space for feature requests, development stories, etc. until we move to a different solution.

What features would you like to see in Watir?
 
 
//WaTiRStoriesRwdtinkerSun May 29 2005 08:02 AM GMT
WaTiR with Rwdtinker using RubyWebDialogs

I have started testing rwdtinker http://rubyforge.org/projects/rwdapplications/

rwdtinker applications are small Ruby applications built to use RubyWebDialogs

I started under windows XP sp2 with watir.tar.gz dated Dec 22, 2004. I was impressed that every button dialog box and clickable link in the application was testable with WaTiR.

I do not use XP at home where I do open source development with Ruby. I decided to try to get WaTir working under Wine on Linux. I use Debian unstable with compiled kernel 2.6.9. I had an old version of crossover office installed. (version 2.1). Nothing worked. I kept installing IE over and over again. I tried Debian unstable version of Wine. I tried 20041212 version of Wine. The errors mostly were com errors related to starting IE. Could not find the registry key {0002DF01-0000-0000-C000-000000000046}. I opened regedit under wine to try yo trouble shoot.

Finally to make the story of a long day, short, I installed the free demo version of a new crossover office. install-crossover-standard-demo-4.1.sh
Using ruby 1.8.2 (2004-11-06) [i386-mswin32] Watir is working like a charm under Linux!

I am building test suites for all my rwdtinker applications.

Thanks for the product.

Steven


 
 
//WaTiRStoriesSun May 29 2005 08:02 AM GMT

Stories From Those Using Watir


Watir with rwdtinker on RubyWebDialogs [[WaTiRStoriesRwdtinker]]
 
 
//AlternativeToolsSun May 29 2005 08:02 AM GMT
Other IE COM/DOM drivers
Perl has Samie. Pamie is a Python port of Samie. Perl also has Win32::IE::Mechanize.

Jiffie:
a Java/JNI library which allows Microsoft Internet Explorer to be controlled from Java. The primary purpose of this library is to allow automated regression testing of web applications using a framework like JUnit.

Jiffie is designed to be simple to use and easy to extend. It is not designed to be a complete implementation of all of the COM interfaces made available by Internet Explorer.

Avignon is a GPL tool for web testing, includes AvignonIE.jar, which can talk to IE via COM. Test scripts are XML.

IeUnit is another COM/DOM driver, this time in JavaScript. Note: this is WSH JavaScript, not in-browser JavaScript.

Python has PyJTF The intention of this package is to test JavaScript code running in a browser. This includes a COM/DOM driver for IE as a host for the test environment.

In-Browser JavaScript-based tools
Selenium is an in-browser testing tool, using JavaScript, that supports many popular browsers. Open source, released by ThoughtWorks.



Any win32 gui library should do the trick as well, though it won't have access to the DOM, right? Uh, right. Except that without the DOM you've got squat. The problem is that the various elements of a page are not win32 GUI controls, so they can't be worked with using such a library. But you could, e.g., directly select menu items. In practice this doesn't take you far.
 
 
//PuTTYWithRubyForgeSun May 29 2005 08:02 AM GMT
PuTTY does not work with rubyforge.net:
Note re: generating an ssh key to avoid always having to login (which is not only a pain but a real mystery if you haven't done it before) ... ssh-keygen with the ssh install that sfsetup.sf.net provides won't work on XP (or NT, probably not 2k either). You can use puttygen.exe, however, and then everything will be hunky-dory.
 
 
//WaTiR/CodingConventionsSun May 29 2005 08:02 AM GMT

General


* Use four spaces for intentation
* Use lower-case and underscores for method names and local/class variables
* User camel case for class names
* Use modules
* Avoid global variables
* Use single-quotes unless you need to use double-quotes
* user lower-case and underscores for file names (don't use minus)
* line length no more than 80 characters
* use do/end instead of {} when the block is more than one line long.

* Follow the standard ruby conventions

Watir Specific


* Class and method names for objects should be the same as the HTML/DOM/JavaScript standards
* All require paths should be relative to the top of the development hierarchy.
 
 
//WaTiR/ChangeLogSun May 29 2005 08:02 AM GMT
Describe ChangeLog here.
 
 
//WaTiR/ToDoSun May 29 2005 08:02 AM GMT
see also //ClIEController/ToDo
 
 
//WaTiR/OverViewSun May 29 2005 08:01 AM GMT
WATIR stands for "Web Application Testing In Ruby." It was birthed in August 2004 in an announcement on BretPettichord's blog:
Web Testing with Ruby

WATIR is based on three earlier versions of test tools in the WTR project. They all drive Internet Explorer (IE) using Ruby, utilizing Ruby's support for COM and IE's extensive COM interface to the the document object model (DOM). You are welcome to review our current work.

* ChrisMorris created the initial version, called ClIEc. It uses several clever techniques to provide an extremely compact api. It is packaged with MoTunes, a demonstration application. This version is labelled IEC.
* My version modified IEC, allowing it identify controls by means other means than names. We’ve also developed tutorial materials for the tool, based on Marick's TimeClock application. Unit tests exercise most of the modifications and tutorial materials. We’ve been teaching this version of the tool in workshops over the past year. The tutorial and the tool are packaged as Scripting101 [see Scripting101Class] and depends on IEC.
* Rogers created a more drastic modification, including detailed logging, to meet the needs at Wireless Matrix (WMX), where it is currently being used in production. A stripped down version of the WMX tool is contained in the Scripting101 distribution in the "contrib" directory. Samples scripts for using it to drive TimeClock are included.

...

The Plan for WATIR

The Agile XP Universe conference in Calgary this week provided an opportunity for us to get our approach reviewed (we taught a tutorial) and have face-to-face discussions for the first time. We've developed plans to develop a new tool, which we are calling WATIR (Web Application Testing in Ruby). Looking at the existing tools in the WTR as spikes, we plan to build a tool from scratch using test-driven development, reusing code from WTR, and building on the unit testing techniques developed in the Scripting101 material. This tool will have 100% coverage by unit tests.

We have sketched out the API to the tool and have secured support from managment at both Wireless Matrix and ThoughtWorks for our participation in this project.

Our initial goal is to build a tool sufficient to support the Scripting101 tutorial. This entails support for buttons, text fields, check boxes and forms, accessing them by name, action or value. Next will be supporting WRX's needs, entailing adding support for radio lists, frames, links, and selection lists. We'll also be adding a logging interface, including selectable output to the console or xml suitable for cruise control.
 
 

|| Find | Recent | Home