Automated GUI testing with JS and AJAX

Automated GUI testing with JS and AJAX

Leonid Podolny leonidp.lists at gmail.com
Thu Sep 3 15:48:30 IDT 2009


Hi, all,
At my work we encountered a problem and it looks like we are
re-inventing the bicycle. Someone here surely has an experience with
that.
We have a regressions testing lab. As a part of the testing we have to
work with the web-interface of our product. (I'm intentionally vague,
the details are quite irrelevant to the problem). The testing scenario
includes action items like "press the button with caption 'Advanced
Settings' on it".
This is implemented as a C program with sockets interface, so "find a
button" actually means "look for a substring in the received HTML
code" and "press the button" means "create an HTTP POST message and
send it".
However, recently we have added some JavaScript and AJAX to the
web-interface and now the testing environment must be able to run JS
and even cope with things like replacing part of the DOM tree. We can
see three possible directions to tackle the problem:
- Further fix our great testing program. After all, we know what AJAX
can return -- we can manually open the connection it would open, parse
the response, etc. Looks ugly and has a potential to turn into
maintenance nightmare.
- Setup a headless X server with Firefox running inside and some sort
of scripting/management add-on. If someone has an experience with such
a setup, I would appreciate pointers to specific add-ons you used.
- Somehow hack off the GUI from any open-source browser and link it to
our program, i.e. use it as HTML parser and JS machine. Looks
unpredictably complicated, maybe not even feasible.



More information about the Linux-il mailing list