in reply to shift method

There are many more tests than 4, in fact, there are 4 times the number of browsers. You can use
my @browsers = sort ( 'chrome', 'internet explorer', 'phantomJS', 'fir +efox' ); run_tests($_) for @browsers; done_testing(4 * @browsers);

instead of planning the number of tests if the number of browsers might change.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: shift method
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:43 UTC

    I am sorry but it doesn't work . I did this :

    use Selenium::Remote::Driver; use Test::More tests=>4; sub run_tests{ my $browser = shift; my $driver = Selenium::Remote::Driver->new( browser_name => $browser +); my @browsers = sort ( 'chrome', 'internet explorer', 'phantomJS', 'f +ir +efox' ); $driver->get("http://www.google.com"); $driver->find_element('q','name')->send_keys("Hello WebDriver!"); ok($driver->get_title =~ /Google/,"title matches google"); is($driver->get_title,'Google',"Title is google"); ok($driver->get_title eq 'Google','Title equals google'); like($driver->get_title,qr/Google/,"Title matches google"); $driver->quit(); } run_tests($_) for @browsers; done_testing(4 * @browsers);

      Look at the example code again. The array of browsers is defined outside of run_tests(), not inside.

      But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

        Oh ! Thx ! i didn't pay attention. I will retry

        Thanks

Re^2: shift method
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:15 UTC

    Thanks . And how i do with

     my $browser = shift;

    ?

Re^2: shift method
by Chaoui05 (Scribe) on Apr 18, 2016 at 15:38 UTC

    Thank you