|
|
@@ -121,6 +121,27 @@ has '+port' => (
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+=attr custom_args
|
|
|
+
|
|
|
+Optional: If you want to pass additional options to the binary when it
|
|
|
+starts up, you can add that here. For example, if your binary accepts
|
|
|
+an argument on the command line like C<--log-path=/path/to/log>, and
|
|
|
+you'd like to specify that the binary uses that option, you could do:
|
|
|
+
|
|
|
+ my $chrome = Selenium::Chrome->new(
|
|
|
+ custom_args => '--log-path=/path/to/log'
|
|
|
+ );
|
|
|
+
|
|
|
+To specify multiple arguments, just include them all in the string.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+has custom_args => (
|
|
|
+ is => 'lazy',
|
|
|
+ predicate => 1,
|
|
|
+ default => sub { '' }
|
|
|
+);
|
|
|
+
|
|
|
=attr startup_timeout
|
|
|
|
|
|
Optional: you can modify how long we will wait for the binary to start
|
|
|
@@ -323,6 +344,9 @@ sub _construct_command {
|
|
|
|
|
|
# The different binaries take different arguments for proper setup
|
|
|
$executable .= $self->_binary_args;
|
|
|
+ if ($self->has_custom_args) {
|
|
|
+ $executable .= ' ' . $self->custom_args;
|
|
|
+ }
|
|
|
|
|
|
# Handle Windows vs Unix discrepancies for invoking shell commands
|
|
|
my ($prefix, $suffix) = ($self->_cmd_prefix, $self->_cmd_suffix);
|