|
|
@@ -16,6 +16,10 @@ sub new {
|
|
|
$self->{'debug'} = $opts{'debug'};
|
|
|
|
|
|
$self->_install_wrapper_subs();
|
|
|
+
|
|
|
+ # Create the session, as users expect this
|
|
|
+ $self->{'_client'}->NewSession();
|
|
|
+
|
|
|
return $self;
|
|
|
}
|
|
|
|
|
|
@@ -94,12 +98,9 @@ my @unimplemented = qw{
|
|
|
|
|
|
sub _install_wrapper_subs {
|
|
|
my ( $self ) = @_;
|
|
|
- foreach my $sub_per_spec (keys(%{$self->{client}{spec}})) {
|
|
|
+ foreach my $sub_per_spec (keys(%{$self->{_client}{spec}})) {
|
|
|
my $sub2install = $cmd_map{$sub_per_spec};
|
|
|
- if( !$sub2install ) {
|
|
|
- print "Can't install a subroutine to match '$sub_per_spec', as it isn't mapped to the S::R::D equivalent!" if $self->{'debug'};
|
|
|
- next;
|
|
|
- }
|
|
|
+ next if( !$sub2install );
|
|
|
|
|
|
# Yo dawg... I herd u like Sub::Install
|
|
|
Sub::Install::install_sub(
|
|
|
@@ -132,7 +133,7 @@ sub is_webdriver_3 { return 0 }
|
|
|
sub has_javascript { return 1 }
|
|
|
sub debug_on { return $_[0]->{'debug'} = 1 }
|
|
|
sub debug_off { return $_[0]->{'debug'} = 0 }
|
|
|
-sub get_sessions { return $_[0]->{'client'}{'sessions'} }
|
|
|
+sub get_sessions { return $_[0]->{'_client'}{'sessions'} }
|
|
|
|
|
|
sub send_keys_to_active_element {
|
|
|
my ($self, $keys) = @_;
|
|
|
@@ -142,7 +143,7 @@ sub send_keys_to_active_element {
|
|
|
|
|
|
sub quit {
|
|
|
my ($self) = @_;
|
|
|
- undef $self->{'client'};
|
|
|
+ undef $self->{'_client'};
|
|
|
return undef $self;
|
|
|
}
|
|
|
*DESTROY = \&quit;
|