1
0
Эх сурвалжийг харах

Suggest use of shutdown_binary in docs

Daniel Gempesaw 9 жил өмнө
parent
commit
4594954102

+ 19 - 0
lib/Selenium/Chrome.pm

@@ -8,6 +8,8 @@ extends 'Selenium::Remote::Driver';
 =head1 SYNOPSIS
 
     my $driver = Selenium::Chrome->new;
+    # when you're done
+    $driver->shutdown_binary;
 
 =head1 DESCRIPTION
 
@@ -99,6 +101,23 @@ up to 20 seconds:
 
 See L<Selenium::CanStartBinary/startup_timeout> for more information.
 
+=method shutdown_binary
+
+Call this method instead of L<Selenium::Remote::Driver/quit> to ensure
+that the binary executable is also closed, instead of simply closing
+the browser itself. If the browser is still around, it will call
+C<quit> for you. After that, it will try to shutdown the browser
+binary by making a GET to /shutdown and on Windows, it will attempt to
+do a C<taskkill> on the binary CMD window.
+
+    $self->shutdown_binary;
+
+It doesn't take any arguments, and it doesn't return anything.
+
+We do our best to call this when the C<$driver> option goes out of
+scope, but if that happens during global destruction, there's nothing
+we can do.
+
 =cut
 
 1;

+ 20 - 0
lib/Selenium/Firefox.pm

@@ -12,9 +12,12 @@ extends 'Selenium::Remote::Driver';
     # greater
     my $driver = Selenium::Firefox->new;
     my $driver = Selenium::Firefox->new( marionette_enabled => 1 );
+    # execute your test as usual
+    $driver->shutdown_binary;
 
     # For Firefox 47 and older, disable marionette:
     my $driver = Selenium::Firefox->new( marionette_enabled => 0 );
+    $driver->shutdown_binary;
 
 =head1 DESCRIPTION
 
@@ -226,6 +229,23 @@ up to 20 seconds:
 
 See L<Selenium::CanStartBinary/startup_timeout> for more information.
 
+=method shutdown_binary
+
+Call this method instead of L<Selenium::Remote::Driver/quit> to ensure
+that the binary executable is also closed, instead of simply closing
+the browser itself. If the browser is still around, it will call
+C<quit> for you. After that, it will try to shutdown the browser
+binary by making a GET to /shutdown and on Windows, it will attempt to
+do a C<taskkill> on the binary CMD window.
+
+    $self->shutdown_binary;
+
+It doesn't take any arguments, and it doesn't return anything.
+
+We do our best to call this when the C<$driver> option goes out of
+scope, but if that happens during global destruction, there's nothing
+we can do.
+
 =cut
 
 1;

+ 21 - 0
lib/Selenium/InternetExplorer.pm

@@ -7,6 +7,8 @@ extends 'Selenium::Remote::Driver';
 =head1 SYNOPSIS
 
     my $driver = Selenium::InternetExplorer->new;
+    # when you're done
+    $driver->shutdown_binary;
 
 =cut
 
@@ -20,4 +22,23 @@ has '+platform' => (
     default => sub { 'WINDOWS' }
 );
 
+=method shutdown_binary
+
+Call this method instead of L<Selenium::Remote::Driver/quit> to ensure
+that the binary executable is also closed, instead of simply closing
+the browser itself. If the browser is still around, it will call
+C<quit> for you. After that, it will try to shutdown the browser
+binary by making a GET to /shutdown and on Windows, it will attempt to
+do a C<taskkill> on the binary CMD window.
+
+    $self->shutdown_binary;
+
+It doesn't take any arguments, and it doesn't return anything.
+
+We do our best to call this when the C<$driver> option goes out of
+scope, but if that happens during global destruction, there's nothing
+we can do.
+
+=cut
+
 1;

+ 19 - 0
lib/Selenium/PhantomJS.pm

@@ -8,6 +8,8 @@ extends 'Selenium::Remote::Driver';
 =head1 SYNOPSIS
 
     my $driver = Selenium::PhantomJS->new;
+    # when you're done
+    $driver->shutdown_binary;
 
 =head1 DESCRIPTION
 
@@ -109,6 +111,23 @@ up to 20 seconds:
 
 See L<Selenium::CanStartBinary/startup_timeout> for more information.
 
+=method shutdown_binary
+
+Call this method instead of L<Selenium::Remote::Driver/quit> to ensure
+that the binary executable is also closed, instead of simply closing
+the browser itself. If the browser is still around, it will call
+C<quit> for you. After that, it will try to shutdown the browser
+binary by making a GET to /shutdown and on Windows, it will attempt to
+do a C<taskkill> on the binary CMD window.
+
+    $self->shutdown_binary;
+
+It doesn't take any arguments, and it doesn't return anything.
+
+We do our best to call this when the C<$driver> option goes out of
+scope, but if that happens during global destruction, there's nothing
+we can do.
+
 =cut
 
 1;