|
|
@@ -2027,6 +2027,167 @@ sub get_active_element {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+=head2 cache_status
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Get the status of the html5 application cache.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ print $driver->cache_status;
|
|
|
+
|
|
|
+ Output:
|
|
|
+ <number> - Status code for application cache: {UNCACHED = 0, IDLE = 1, CHECKING = 2, DOWNLOADING = 3, UPDATE_READY = 4, OBSOLETE = 5}
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub cache_status {
|
|
|
+ my ($self) = @_;
|
|
|
+ my $res = { 'command' => 'cacheStatus' };
|
|
|
+ return $self->_execute_command($res);
|
|
|
+}
|
|
|
+
|
|
|
+=head2 set_geolocation
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Set the current geographic location - note that your driver must
|
|
|
+ implement this endpoint, or else it will crash your session. At the
|
|
|
+ very least, it works in v2.12 of Chromedriver.
|
|
|
+
|
|
|
+ Input:
|
|
|
+ Required:
|
|
|
+ HASH: A hash with key C<location> whose value is a Location hashref. See
|
|
|
+ usage section for example.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ $driver->set_geolocation( location => {
|
|
|
+ latitude => 40.714353,
|
|
|
+ longitude => -74.005973,
|
|
|
+ altitude => 0.056747
|
|
|
+ });
|
|
|
+
|
|
|
+ Output:
|
|
|
+ BOOLEAN - success or failure
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub set_geolocation {
|
|
|
+ my ( $self, %params ) = @_;
|
|
|
+ my $res = { 'command' => 'setGeolocation' };
|
|
|
+ return $self->_execute_command( $res, \%params );
|
|
|
+}
|
|
|
+
|
|
|
+=head2 get_geolocation
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Get the current geographic location. Note that your webdriver must
|
|
|
+ implement this endpoint - otherwise, it will crash your session. At
|
|
|
+ the time of release, we couldn't get this to work on the desktop
|
|
|
+ FirefoxDriver or desktop Chromedriver.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ print $driver->get_geolocation;
|
|
|
+
|
|
|
+ Output:
|
|
|
+ { latitude: number, longitude: number, altitude: number } - The current geo location.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub get_geolocation {
|
|
|
+ my ($self) = @_;
|
|
|
+ my $res = { 'command' => 'getGeolocation' };
|
|
|
+ return $self->_execute_command($res);
|
|
|
+}
|
|
|
+
|
|
|
+=head2 get_log
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Get the log for a given log type. Log buffer is reset after each request.
|
|
|
+
|
|
|
+ Input:
|
|
|
+ Required:
|
|
|
+ <STRING> - Type of log to retrieve:
|
|
|
+ {client|driver|browser|server}. There may be others available; see
|
|
|
+ get_log_types for a full list for your driver.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ $driver->get_log( $log_type );
|
|
|
+
|
|
|
+ Output:
|
|
|
+ <ARRAY|ARRAYREF> - An array of log entries since the most recent request.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub get_log {
|
|
|
+ my ( $self, $type ) = @_;
|
|
|
+ my $res = { 'command' => 'getLog' };
|
|
|
+ return $self->_execute_command( $res, { type => $type });
|
|
|
+}
|
|
|
+
|
|
|
+=head2 get_log_types
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Get available log types. By default, every driver should have client,
|
|
|
+ driver, browser, and server types, but there may be more available,
|
|
|
+ depending on your driver.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ my @types = $driver->get_log_types;
|
|
|
+ $driver->get_log($types[0]);
|
|
|
+
|
|
|
+ Output:
|
|
|
+ <ARRAYREF> - The list of log types.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub get_log_types {
|
|
|
+ my ($self) = @_;
|
|
|
+ my $res = { 'command' => 'getLogTypes' };
|
|
|
+ return $self->_execute_command($res);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+=head2 set_orientation
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Set the browser orientation.
|
|
|
+
|
|
|
+ Input:
|
|
|
+ Required:
|
|
|
+ <STRING> - Orientation {LANDSCAPE|PORTRAIT}
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ $driver->set_orientation( $orientation );
|
|
|
+
|
|
|
+ Output:
|
|
|
+ BOOLEAN - success or failure
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub set_orientation {
|
|
|
+ my ( $self, $orientation ) = @_;
|
|
|
+ my $res = { 'command' => 'setOrientation' };
|
|
|
+ return $self->_execute_command( $res, { orientation => $orientation } );
|
|
|
+}
|
|
|
+
|
|
|
+=head2 get_orientation
|
|
|
+
|
|
|
+ Description:
|
|
|
+ Get the current browser orientation. Returns either LANDSCAPE|PORTRAIT.
|
|
|
+
|
|
|
+ Usage:
|
|
|
+ print $driver->get_orientation;
|
|
|
+
|
|
|
+ Output:
|
|
|
+ <STRING> - your orientation.
|
|
|
+
|
|
|
+=cut
|
|
|
+
|
|
|
+sub get_orientation {
|
|
|
+ my ($self) = @_;
|
|
|
+ my $res = { 'command' => 'getOrientation' };
|
|
|
+ return $self->_execute_command($res);
|
|
|
+}
|
|
|
+
|
|
|
=head2 send_modifier
|
|
|
|
|
|
Description:
|