in reply to Re: How to have 2 functions in one Perl file
in thread How to have 2 functions in one Perl file
I would to do something like that for example, with 2 functions also. Do you think it's possible and how ? Thanks
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' ); sub run_testing{ my $browser = shift; my $driver = Selenium::Remote::Driver->new( browser_name => $browser +); $driver->get("http://www.google.com"); $driver->pause(2000); $driver->set_window_size(640, 480); $driver->find_element('login','name') $driver->find_element('password','name') $driver->quit(); } run_testing ($_) for sort ( 'chrome', 'internet explorer', 'phantomJS' +, 'firefox' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to have 2 functions in one Perl file
by SimonPratt (Friar) on Apr 18, 2016 at 14:43 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 15:29 UTC | |
by SimonPratt (Friar) on Apr 18, 2016 at 15:48 UTC | |
by Chaoui05 (Scribe) on Apr 19, 2016 at 09:35 UTC | |
by SimonPratt (Friar) on Apr 19, 2016 at 12:32 UTC | |
|
Re^3: How to have 2 functions in one Perl file
by stevieb (Canon) on Apr 18, 2016 at 14:19 UTC | |
by Chaoui05 (Scribe) on Apr 18, 2016 at 15:37 UTC |