Chapter 21.4. Selenium

Mechanize is great but sometimes you need to be able to see the test with your own eyes to make sure everything is correct and placed in the right place. Selenium is a great tool that helps you run tests inside the browser. You install Selenium into your web server. We recommend /static/selenium in your TurboGears project. Make sure that the following section is in your config/app.cfg. It should be included by default:

[/static]
static_filter.on = True
static_filter.dir = "%(top_level_dir)s/static"

Selenium works by injecting JavaScript code into your application that executes in the browser on the client side. The benefit is that Selenium’s code can interact very intimately with the HTML DOM of your application. You ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.