Wednesday, July 14th, 2010
Synthetic Event Library Syn Aims to Make Testing Easier
The team at Jupiter IT have release Syn, a library which allows you to create synthetic events for use in testing. This standalone library is meant to assist in testing complex UI behavior by simulating user actions such as typing, clicking, dragging the mouse.
Testing rich, dynamic web applications sucks. At Jupiter, we’ve tried almost every testing solution available (qUnit, Quick Test Pro, Selenium, JsUnit, Env.js, TestCase) and all of them suffer from some fatal flaw.
Problems:
- Manual – A tester has to run the tests manually on every supported browser. People are lazy.
- Unit Tests Only – We need to test the app as a whole and complex UI behavior like drag-drop.
- Low fidelity – We need to make sure the tests are reporting accurate results.
- Difficult to write – We sling JS like a ninja monkey throws poo. We want to write tests in a nice JS API.
- Expensive – A QTP license is 5k a person! I’d rather buy a vacation.
- Support – We want to test Mac and Linux browsers.
We’ve solved all of these problems in our upcoming FuncUnit testing framework. It’s a mashup of qUnit, Selenium, Rhino, and Env.js. But its core library, Syn, which does the work of simulating user actions with very high fidelity, is what we are releasing today.
So by using code like this:
- Syn.click( {},'hello' )
- .type( 'Hello World' )
- .drag( $('#trash') );
you can simulate clicking an element with id=’hello’, typing “Hello World”, and then dragging your mouse from that element to an element with id=’trash’.
Pretty cool stuff. Check out their demo to see how playback occurs.





looks very nice
Holy crap, this looks awesome. I’ve been trying to record user action for my (extremely basic) UI testing framework (http://github.com/mennovanslooten/UITest) but have miserably failed so far. These guys seem to have nailed it.
Really slick, very impressed! Love how simple it looks, syntax and all.
Cool…But what about the synthetic events that the browser doesn’t like?
For example, pressing “TAB” to change focus from one field to another?
Looks great to me.
@randonrandom, Syn.type(‘0\t1\t2’) will tab through a form. Yes, Syn is that awesome.