I had a similar question, which led me to the Webdriver project (now part of selenium).

I haven't done any experiments yet, but the idea of driving the browser via its API is appealing.

The Parasol project says it is a Webdriver implementation for Pharo, and it looks quite exciting. The build is currently failing, but that seems to be a gemstone problem.

https://github.com/SeasideSt/Parasol/blob/master/README.md

If you have time to play with it I would love to hear your experience.

Cheers
Andy