in reply to Re: shift method
in thread shift method

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);

Replies are listed 'Best First'.
Re^3: shift method
by GotToBTru (Prior) on Apr 18, 2016 at 12:31 UTC

    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