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

In reply to Re^2: How to have 2 functions in one Perl file by Chaoui05
in thread How to have 2 functions in one Perl file by Chaoui05

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.