AnyEvent-WebDriver

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


    $wd->close_window
        Closes the current browsing context.

    $wd->switch_to_window ($handle)
        Changes the current browsing context to the given window.

    $handles = $wd->get_window_handles
        Return the current window handles as an array-ref of handle IDs.

    $handles = $wd->switch_to_frame ($frame)
        Switch to the given frame identified by $frame, which must be either
        "undef" to go back to the top-level browsing context, an integer to
        select the nth subframe, or an element object.

    $handles = $wd->switch_to_parent_frame
        Switch to the parent frame.

    $rect = $wd->get_window_rect
        Return the current window rect(angle), e.g.:

           $rect = $wd->get_window_rect
           => { height => 1040, width => 540, x => 0, y => 0 }

    $wd->set_window_rect ($rect)
        Sets the window rect(angle), e.g.:

WebDriver.pm  view on Meta::CPAN

use common::sense;

use Carp ();
use AnyEvent ();
use AnyEvent::HTTP ();

our $VERSION = '1.2';

our $WEB_ELEMENT_IDENTIFIER = "element-6066-11e4-a52e-4f735466cecf";
our $WEB_WINDOW_IDENTIFIER  =  "window-fcc6-11e5-b4f8-330a88ab9d7f";
our $WEB_FRAME_IDENTIFIER   =   "frame-075b-4da1-b6ba-e579c2d3230a";

my $json = eval { require JSON::XS; JSON::XS:: } || do { require JSON::PP; JSON::PP:: };
$json = $json->new->utf8;

$json->boolean_values (0, 1)
   if $json->can ("boolean_values");

sub _decode_base64 {
   require MIME::Base64;

WebDriver.pm  view on Meta::CPAN

=item $handles = $wd->get_window_handles

Return the current window handles as an array-ref of handle IDs.

=cut

sub get_window_handles_ {
   $_[0]->get_ ("window/handles" => $_[1]);
}

=item $handles = $wd->switch_to_frame ($frame)

Switch to the given frame identified by C<$frame>, which must be either
C<undef> to go back to the top-level browsing context, an integer to
select the nth subframe, or an element object.

=cut

sub switch_to_frame_ {
   $_[0]->post_ (frame => { id => "$_[1]" }, $_[2]);
}

=item $handles = $wd->switch_to_parent_frame

Switch to the parent frame.

=cut

sub switch_to_parent_frame_ {
   $_[0]->post_ ("frame/parent" => undef, $_[1]);
}

=item $rect = $wd->get_window_rect

Return the current window rect(angle), e.g.:

   $rect = $wd->get_window_rect
   => { height => 1040, width => 540, x => 0, y => 0 }

=item $wd->set_window_rect ($rect)



( run in 0.688 second using v1.01-cache-2.11-cpan-df04353d9ac )