I had a perl script which executes in Multiple browsers parallely. I need to set this script in sub setup() which continues execution . I face a problem as the setup () encounters the end of sub }
The code is as follows:
my @browser = ('*firefox','*iexplore');
my $i = @browser;
$pm = new Parallel::ForkManager($i);
foreach $browser (@browser){
$pid = $pm->start and next;
$sel = WWW::Selenium->new( host => $host , port => 4444, browser => $browser, browser_url => $url,);
$sel->start();
print("\n Execution : ".$browser."\n");
$sel->open("/");
$pm->finish();
}
We can use startup and shutdown methods . For reference check this.
Passing Parameter to Test::Class Setup method