PBP

Python Browser Poseur

About

PBP is a web test tool based on John J. Lee's mechanize. It exposes the browser functionality at the level of a shell-like interpreter so that testers can quickly write tests in a simple language designed specifically for that purpose. Anyone familiar with a command line should be able to write test scripts for even the most complex web applications with PBP.

More detail is available at the Wiki.

News

2004-11-06T13:48-0700

Making Progress on Next Release

Oh point four is coming soon. I've done the hard part, which is the http auth stuff. The other major thing remaining is comparison testing for the current form values. Check the roadmap page for progress.

2004-07-24T00:44-0700

Minor Project Name Change

PBP now stands for “Python Browser Poseur” instead of “Python Browsing Probe.” I was getting a lot of porn referrals with the other name. Don't ask. Links to everything but the first page of the Wiki will still work; for that one link, use the Wiki link on this page as your new bookmark.

2004-07-05T18:22-0700

0.3.0 Important Feature Release

Major changes are: a command to let testers set the user-agent string and impersonate a different browser, an ‘echo’ command for writing text into the output, well-behaved shell exit status (>0 if there's a script error), and bugs fixed.

How-To

$ python pbpscript
PBP> go http://mailinator.com
done at http://www.mailinator.com/mailinator/Welcome.do
PBP> code 200
OK: code was 200
PBP> find "property of Outsc.*me"
OK: found property of Outsc.*me
PBP> showform
Form name=search
## __Name______ __Type___ __ID________ __Value__________________
   email        text      (None)       
PBP> formvalue search email pbp.berlios.de
Set email in search to value pbp.berlios.de
PBP> submit search
done at http://www.mailinator.com/mailinator/CheckMail.do
PBP> code 200
OK: code was 200
PBP> find "no mensajes"
*** ERROR ***
Page http://www.mailinator.com/mailinator/CheckMail.do didn't match the search
string: no mensajes
PBP> find "NO MESSAGES"
OK: found NO MESSAGES
PBP> back
OK, back at http://www.mailinator.com/mailinator/Welcome.do
PBP> history
go http://mailinator.com
code 200
find "property of Outsc.*me"
showform
formvalue search email pbp.berlios.de
submit search
code 200
find "no mensajes"
find "NO MESSAGES"
back
history
PBP> history mylog.txt
PBP> quit
Bye.

Prerequisites (Dependencies)

Downloads

Source Code / SVN

To check out the source code for PBP:

$ svn co svn://svn.berlios.de/pbp/trunk pbp

You can use A-A-P to build packages from the included main.aap file.


“Competing” Projects

Twill, in the Links menu, is a reimplementation of PBP written by an upstanding human being named Titus Brown. It seems to do everything PBP does with the single exception that it doesn't have a mechanism to follow refreshes like PBP's go command. I recommend you check it out, and also submit a patch so it does follow refreshes, because it would be nice if someone else was doing my work for me.

BerliOS Developer Logo