Hi Gary,

On Tue, 4 Sep 2012 13:10:04 +0100
Gary Stainburn <gary.stainb...@ringways.co.uk> wrote:

> Hi folks
> 
> After a number of weeks I'm returning to my poject to automate some
> file downloads.  I've installed Win32::Watir and typed in the example
> program.
> 
> However, it doesn't run. I've had a look at the code and I can't see
> why it is complaining. Can anyone help
> 
> Gary
> 
> C:\Documents and Settings\user1\My Documents>type watir_test.pl
> use Win32::Watir;
> 

You're missing strict and warnings:

http://perl-begin.org/tutorials/bad-elements/

> my $ie = Win32::Watir::new(
>  visible => 1,
>  maximize =>1
> );

This is wrong (even though it is taken from 
https://metacpan.org/module/Win32::Watir 's synopsis.
It should be:

my $ie = Win32::Watir->new(
        visible => 1,
        maximize =>1
);

Regards,

        Shlomi Fish

> $ie->goto("http://www.google.co.uk";);
> $ie->text_field('name:',"q")->setvalue("Perl Win3::Watir");
> 
> 
> C:\Documents and Settings\user1\My Documents>perl watir_test.pl
> Odd number of elements in hash assignment at 
> C:/strawberry/perl/site/lib/Win32/W
> atir.pm line 102.
> Can't locate object method "_check_os_name" via package "visible" at 
> C:/strawber
> ry/perl/site/lib/Win32/Watir.pm line 106.
> 
> 
> 
> The new() method looks like:
> sub new {
>       my $class = shift;
>       my %opts = @_;            # Line 102
>       $opts{visible} = 1  unless (exists $opts{visible});
>       $warn = $opts{warnings} if (exists $opts{warnings});
>       my $self = bless (\%opts, $class);
>       $self->_check_os_name();    # line 106
>       if ( $opts{'ie'} or $opts{'find'} ){
>               return $self->_startCustomIE();
>       } else {
>               return $self->_startIE();
>       }
> }
> 



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

The conversation about how someone shouldn’t do something in an IRC channel is
always at least twice as long as the text the accused person created in the
first place — Chris62vw’s Rule

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to