ソースを参照

Don't do log redirection when using jar on windows

George S. Baugh 4 年 前
コミット
5ce40076da
1 ファイル変更7 行追加1 行削除
  1. 7 1
      lib/Selenium/Client.pm

+ 7 - 1
lib/Selenium/Client.pm

@@ -227,7 +227,13 @@ sub _do_spawn($self) {
     #XXX so we have to just bg & ignore, unfortunately (also have to system())
     if (_is_windows()) {
         $self->{pid} = qq/$self->{driver}:$self->{port}/;
-        my $cmdstring = join(' ', "start /MIN", qq{"$self->{pid}"}, @{$self->{command}}, '>', $self->{log_file}, '2>&1');
+        my @cmdprefix = ("start /MIN", qq{"$self->{pid}"});
+
+        # Selenium JAR controls it's own logging because Java
+        my @cmdsuffix;
+        @cmdsuffix = ('>', $self->{log_file}, '2>&1') unless $self->{driver_class} eq 'Selenium::Driver::SeleniumHQ::Jar';
+
+        my $cmdstring = join(' ', @cmdprefix, @{$self->{command}}, @cmdsuffix );
         print "$cmdstring\n" if $self->{debug};
         system($cmdstring);
         return $self->_wait();