Chaoui05 has asked for the wisdom of the Perl Monks concerning the following question:
Hey guys ! I am a beginner in Perl ( yes it can exist ) and i would to create a function which switch between different browser to test a code , instructions). I did that but it doesn't work ?!
use Selenium::Remote::Driver; use Test::More tests=>4; sub run_tests{ my $browser = shift; my $driver = Selenium::Remote::Driver->new( browser_name => $browser +); $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 sort ( 'chrome', 'internet explorer', 'phantomJS', +'firefox' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: shift method
by Discipulus (Canon) on Apr 18, 2016 at 08:39 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:28 UTC | |
|
Re: shift method
by choroba (Cardinal) on Apr 18, 2016 at 08:56 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:43 UTC | |
by GotToBTru (Prior) on Apr 18, 2016 at 12:31 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 14:13 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 14:15 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 10:15 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 15:38 UTC |