browser controller testing for webapps (in windows environment)

10

Click here to load reader

Upload: adrian-spinei

Post on 28-Jun-2015

2.822 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Browser controller testing for webapps (in Windows environment)

1

Wurbe #5 Pag. 1/10

Tales from the dark side:browser controller testing

for webapps inWindows environment

Adrian Spineinetuality.ro

Page 2: Browser controller testing for webapps (in Windows environment)

2

Wurbe #5 Pag. 2/10

Blackbox testingaka data testing, behavioral testing+ only tests functionality+ does not need server instrumentation+ easy to understand- sometimes performed by humans(and humans do not like it)- relatively hard to maintain- coverage of what ?

Page 3: Browser controller testing for webapps (in Windows environment)

3

Wurbe #5 Pag. 3/10

Webapp testing before 2004-2005Mostly browser simulator(headless) patterneg. in Java:httpunithtmlunit...(inspired from junit/xunitcirca 1999 – Kent Beck,Erich Gamma)

Page 4: Browser controller testing for webapps (in Windows environment)

4

Wurbe #5 Pag. 4/10

2005 – AJAX becomes de facto standard- Only HTML parsing is not good enough- Rhino ? No support for browser-specific objects- It's not easy to “rewrite” the browserSolution ?Browser controller – run a fullfledged browser instance anduse automation techniquesto control and check data

Page 5: Browser controller testing for webapps (in Windows environment)

5

Wurbe #5 Pag. 5/10

Windows !+ massive user base+ IE still the dominant browser+ large variety of tools(commercial and open-source)+ OS automation APIs- mono-platform- makes you totally uncool- definitely will not improve your sex life

Page 6: Browser controller testing for webapps (in Windows environment)

6

Wurbe #5 Pag. 6/10

Mainstream opensource & free toolsfor browser control/automationSamie (Perl)Pamie (Python)WatiR (Ruby)WatiN (.Net)AutoIT (Basic)...probably more(just Google it)

Page 7: Browser controller testing for webapps (in Windows environment)

7

Wurbe #5 Pag. 7/10

But can you script any type of webapp ?Take Gmail, for instance – hard to blackbox(for sure it is instrumented for white box testing, debug,some REST equivalents, but that's not the point)●(relatively) unpredictable id values●very often, no names for elements●compose mail = a SPAN element, not a link●email body is written inside a ... BODY tag

Page 8: Browser controller testing for webapps (in Windows environment)

8

Wurbe #5 Pag. 8/10

Yes you can.One of the solutions:●WatiNhttp://watin.sourceforge.net/●scripted with IronPythonhttp://www.codeplex.com/IronPython●spiced with WinForms.SendKeys... demo time !

Page 9: Browser controller testing for webapps (in Windows environment)

9

Wurbe #5 Pag. 9/10

One more thing ...

Page 10: Browser controller testing for webapps (in Windows environment)

10

Wurbe #5 Pag. 10/10

The Epiphany – testing is useless :)“Instead of wasting your time withtests, you'd better writebug-free code in the first place !”Customer, circa 2004(name withhold toprotect the innocents)