The document discusses browser controller testing for web applications in a Windows environment, noting that while blackbox testing does not require server instrumentation and is easy to understand, it can be hard to maintain and determine coverage. It then provides examples of mainstream open source tools for browser control and automation like WatiN, and discusses how more complex sites like Gmail can still be tested through techniques like scripting WatiN with IronPython and using WinForms controls.
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Browser controller testing for webapps (in Windows environment)
1. Tales from the dark side:
browser controller testing
for webapps in
Windows environment
Adrian Spinei
netuality.ro
1
Wurbe #5 Pag. 1/10
2. Blackbox testing
aka 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 ?
2
Wurbe #5 Pag. 2/10
3. Webapp testing before 2004-2005
Mostly browser simulator
(headless) pattern
eg. in Java:
httpunit
htmlunit
...
(inspired from junit/xunit
circa 1999 – Kent Beck,
Erich Gamma)
3
Wurbe #5 Pag. 3/10
4. 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 browser
Solution ?
Browser controller – run a full
fledged browser instance and
use automation techniques
to control and check data
4
Wurbe #5 Pag. 4/10
5. 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
5
Wurbe #5 Pag. 5/10
6. Mainstream opensource & free tools
for browser control/automation
Samie (Perl)
Pamie (Python)
WatiR (Ruby)
WatiN (.Net)
AutoIT (Basic)
...
probably more
(just Google it)
6
Wurbe #5 Pag. 6/10
7. 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
7
Wurbe #5 Pag. 7/10
8. Yes you can.
One of the solutions:
●
WatiN
http://watin.sourceforge.net/
●
scripted with IronPython
http://www.codeplex.com/IronPython
●
spiced with WinForms.SendKeys
... demo time !
8
Wurbe #5 Pag. 8/10
10. The Epiphany – testing is useless :)
“Instead of wasting your time with
tests, you'd better write
bug-free code in the first place !”
Customer, circa 2004
(name withhold to
protect the innocents)
10
Wurbe #5 Pag. 10/10