Sorry to join the party late! It is perfectly fine to run tests with Dancer and WWW::Mechanize. Since Dancer is a listener, the easiest way for you to do so (and the way we do it in our core tests) is using Test::TCP. Here is a small example of how to do it. I used Test::WWW::Mechanize to reduce the testing code itself: #!/usr/bin/perl use strict; use warnings; use Test::More import => ['!pass']; use Test::TCP; use Test::WWW::Mechanize; test_tcp( client => sub { my $port = shift; my $mech = Test::WWW::Mechanize->new(); my $main = "http://localhost:$port"; $mech->get_ok("$main/"); $mech->get_ok("$main/hello"); $mech->title_is('Hello world'); }, server => sub { use Dancer; my $port = shift; setting access_log => 0; setting port => $port; get '/' => sub {1}; get '/hello' => sub { return '<html><head><title>Hello world</title></head></html>'; }; start; }, ); done_testing();