Skip to content

Commit 9b3ac65

Browse files
author
George S. Baugh
committed
Fix #418 : deal with chromedriver being broken out of the box
this is why we can't have nice things
1 parent a211112 commit 9b3ac65

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Revision history for Selenium-Remote-Driver
22

3+
1.33 06-17-2019 TEODESIAN
4+
[BUG FIXES]
5+
- Add chrome shim to disable sandboxing by default so that Selenium::Chrome usage isn't broken by default
6+
- Report failures to obtain sessions better
7+
38
1.32 06-12-2019 TEODESIAN
49
[New Features]
510
- Add support for mozilla full pags screenshots

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = Selenium-Remote-Driver
2-
version = 1.32
2+
version = 1.33
33
author = George S. Baugh <george@troglodyne.net>
44
author = Aditya Ivaturi <ivaturi@gmail.com>
55
author = Daniel Gempesaw <gempesaw@gmail.com>

lib/Selenium/Remote/Driver.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,14 @@ sub _request_new_session {
10231023
}
10241024
}
10251025

1026+
#Fix broken out of the box chrome because they hate the maintainers of their interfaces
1027+
if ( $self->isa('Selenium::Chrome') ) {
1028+
if ( exists $args->{desiredCapabilities} ) {
1029+
$args->{desiredCapabilities}{chromeOptions}{args} //= [];
1030+
push(@{$args->{desiredCapabilities}{chromeOptions}{args}}, qw{no-sandbox disable-dev-shm-usage});
1031+
}
1032+
}
1033+
10261034
# Get actual status
10271035
$self->remote_conn->check_status();
10281036

@@ -1037,6 +1045,10 @@ sub _request_new_session {
10371045
my $rc = $self->remote_conn;
10381046
my $resp = $rc->request( $resource_new_session, $args, );
10391047

1048+
if ( $resp->{cmd_status} && $resp->{cmd_status} eq 'NOT OK' ) {
1049+
croak "Could not obtain new session: ". $resp->{cmd_return}{message};
1050+
}
1051+
10401052
if ( ( defined $resp->{'sessionId'} ) && $resp->{'sessionId'} ne '' ) {
10411053
$self->session_id( $resp->{'sessionId'} );
10421054
}

0 commit comments

Comments
 (0)