use Try::Tiny;
use LWP::UserAgent;
use HTTP::Headers;
use HTTP::Request;
use Carp qw(croak);
use JSON;
use Data::Dumper;
use Selenium::Remote::ErrorHandler;
use Scalar::Util qw{looks_like_number};
h
source->{payload}->{$key};
}
}
my $json = JSON->new;
$json->allow_blessed;
$content = $json->allow_nonref->utf8->encode($params);
}
print "REQ: $m
eader =
HTTP::Headers->new( Content_Type => 'application/json; charset=utf-8' );
$header->header( 'Accept' => 'application/json' );
my $request = HTTP::Request->new( $method, $fullurl, $
=> sub { $_[0] ? JSON::true : JSON::false },
default => sub { return JSON::true }
);
has 'accept_ssl_certs' => (
is => 'rw',
coerce => sub { $_[0] ? JSON::true : JSON::false },
de
fault => sub { return JSON::true }
);
has 'proxy' => (
is => 'rw',
coerce => sub {
my $proxy = $_[0];
if ( $proxy->{proxyType} =~ /^pac$/i ) {
if ( not defined
sed to be used by
# end user. This method is used by Driver to set up all the parameters
# (url & JSON), send commands & receive processed response from the server.
sub _execute_command {
my ( $se
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
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
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: