Writing perl unit tests which need to simulate a web browser with cookie support connecting to a server from multiple network interfaces is challenging. Why would I need to do that? Well, when you work for a company whose business is providing controlled internet access to hotels, these sorts of things come up.
I’m not asking for help — I already know how to approach the problem. I’m just stating a fact. You know, in case anybody was curious about what I’m working on these days.


















4 Comments
Not sure if you’re coding in PHP or not, if so this couold be useful.
Nope, this doesn’t involve any PHP, just Perl (Apache/mod_perl, Mason). But I’m always happy to have links to good PHP resources
Are you using WWW::Mechanize?
Yes, we’re using WWW::Mechanize for the browser emulation. The tricky part for my testing is that I need to simulate a computer which switches network interfaces. For example, a laptop that first connects via a wired ethernet port, then later connects via a wireless interface.
To test this, I have to change the MAC address of my test computer on the fly, as well as mucking about with our custom subclass of WWW::Mechanize.