patricklee has asked for the wisdom of the Perl Monks concerning the following question:

use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More "no_plan"; use Test::Exception; my $sel = Test::WWW::Selenium->new( host => "localhost", port => 4444, browser => "*firefox", browser_url => "http://seleniumhq. +org/projects/" ); $sel->open_ok("/projects/"); $sel->click_ok("link=Download"); $sel->wait_for_page_to_load_ok("30000"); $sel->click_ok("link=Projects"); $sel->wait_for_page_to_load_ok("30000"); $sel->click_ok("link=Download"); $sel->wait_for_page_to_load_ok("30000"); $sel->click_ok("link=Documentation"); $sel->wait_for_page_to_load_ok("30000"); $sel->click_ok("link=Support"); $sel->wait_for_page_to_load_ok("30000"); $sel->click_ok("link=About"); $sel->wait_for_page_to_load_ok("30000");

I am trying to get my firefox browser to launch but I get the error message. 18:28:49.990 INFO - Got result: Failed to start new browser session: java.lang.R untimeException: Firefox 3 could not be found in the path! Please add the directory containing ''firefox.exe'' to your PATH environment variable, or explicitly specify a path to Firefox 3 like this: *firefox3c:\blah\firefox.exe on session null

When I inserted the path to the firefox.exe file. I get a list of browsers that perl supports.

example Supported browsers include: *firefox *mock *firefoxproxy *pifirefox *chrome *iexploreproxy *iexplore *firefox3 *safariproxy *googlechrome *konqueror *firefox2 *safari *piiexplore *firefoxchrome *opera *iehta *custom

Replies are listed 'Best First'.
Re: Perl code is not lunching my firefox browser
by Corion (Patriarch) on Jan 24, 2011 at 09:01 UTC

    Looking at the WWW::Selenium documentation, it seems that it wants a whitespace-delimited command:

    my $where_firefox_lives = "C:\\Program Files\\Mozilla Firefox\\firefox +.exe"; ... browser => "firefox3 $where_firefox_lives", ...

      Thank you this worked out great. I corrected the path name to Program Files (86)\\Mozilla Firefox\\firefox.exe. The browser will not launch when I compile the program. Thanks again I really appreciate this.

Re: Perl code is not lunching my firefox browser
by The Perlman (Scribe) on Jan 24, 2011 at 10:53 UTC
    > Perl code is not lunching my firefox browser

    Doesn't surprise me if you feed Opera and Safari for breakfast!

    SCNR! ;-)