Help for this page
use strict; use warnings; ... sleep 1; # give the page more time $mech->click({xpath => '//*[@id="submit"]'});
my $retries = 10; while ($retries-- and ! $mech->is_visible( xpath => '//*[@id="submit"] +' )) { sleep 1; }; die "Timeout" unless $retries;