=head2 Remote Driver Response
Selenium::Remote::Driver uses the L<JsonWireProtocol|http://code.google.com/p/selenium/wiki/JsonWireProtocol> to communicate with the
Selenium Server. If an error oc
rver
sends back an HTTP error code with a JSON encoded reponse that indicates the
precise L<Response Error Code|http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes>. The mo
$self->{javascript} = JSON::true;
}
else {
$self->{javascript} = JSON::false;
}
}
else {
$self->{javascript} = JSON::true;
}
for the duration of the session.
Proxy configuration: "proxy" JSON Defines the current session’s proxy configuration.
New Stuff:
Page load strategy:
Resizing and Positioning Windows.
Session timeouts configuration: "timeouts" JSON Describes the timeouts imposed on certain session operations.
Unhandled prompt behavior:
Temp;
use File::Basename qw(dirname);
use IO::Uncompress::Unzip 2.030 qw($UnzipError);
use JSON qw(decode_json);
use MIME::Base64;
use Scalar::Util qw(blessed looks_like_number);
use XML::Simple;
s
keys %prefs ) {
my $value = $prefs{$_};
my $clean_value = '';
if ( JSON::is_bool($value) ) {
$self->set_boolean_preference( $_, $value );
next;
ou can set
multiple preferences at once. If you need to set a boolean preference,
either use JSON::true/JSON::false, or see C<set_boolean_preference()>.
$profile->set_preference("quoted.integer.p
utility class to mock the responses from Selenium server
use strict;
use warnings;
use Moo;
use JSON;
use Carp;
use Try::Tiny;
use HTTP::Response;
use Data::Dumper;
extends 'Selenium::Remote::Remot
undef;
my $json = JSON->new;
$json->allow_blessed;
my $decoded_json = $json->allow_nonref(1)->utf8(1)->decode(<$fh>);
close($fh);
$self->session_store($decoded_json);
}
sub dump_
n_store->{$path};
}
my $json = JSON->new;
$json->allow_blessed;
my $json_session = $json->allow_nonref->utf8->pretty->encode($dump);
print $fh $json_session;
close($fh);
}
sub
LWP::UserAgent;
use HTTP::Headers;
use HTTP::Request;
use Net::Ping;
use Carp qw(croak);
use JSON;
use Data::Dumper;
use Selenium::Remote::ErrorHandler;
sub new {
my ($class, $remote_
ub/$url";
}
if ((defined $params) && $params ne '') {
my $json = new JSON;
$content = $json->allow_nonref->utf8->encode($params);
}
# HTTP request
my $ua
header =
HTTP::Headers->new(Content_Type => 'application/json; charset=utf-8');
$header->header('Accept' => 'application/json');
my $request = HTTP::Request->new($method, $fullurl, $h