Appium
view release on metacpan or search on metacpan
lib/Appium.pm view on Meta::CPAN
}
sub set_network_connection {
my ($self, $connection_bitmask) = @_;
my $res = { command => 'set_network_connection' };
my $params = {
parameters => {
type => $connection_bitmask
}
};
return $self->_execute_command( $res, $params );
}
sub is_android {
return shift->_type eq 'Android';
}
sub is_ios {
return shift->_type eq 'iOS';
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Appium - Perl bindings to the Appium mobile automation framework (WIP)
=for markdown [](https://travis-ci.org/appium/perl-client)
=head1 VERSION
version 0.0804
=head1 SYNOPSIS
my $appium = Appium->new(caps => {
app => '/url/or/path/to/mobile/app.zip'
});
$appium->page;
$appium->find_element('TextField1', 'name')->send_keys('5');
$appium->quit;
=head1 DESCRIPTION
Appium is an open source test automation framework for use with native
and hybrid mobile apps. It drives iOS and Android apps using the
WebDriver JSON wire protocol. This module is a thin extension of
L<Selenium::Remote::Driver> that adds Appium specific API endpoints
and Appium-specific constructor defaults. It's woefully incomplete at
the moment, so feel free to pitch in at the L<Github
repo|https://github.com/appium/perl-client>! For details on how Appium
extends the Webdriver spec, see the Selenium project's L<spec-draft
document|https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile>.
Note that like L<Selenium::Remote::Driver>, you shouldn't have to
instantiate L<Appium::Element> on your own; this module will create
them when necessary so that all you need to know is what methods are
appropriate on an element vs the driver.
my $appium = Appium->new( caps => { app => '/path/to/app.zip' } );
# automatically instantiates Appium::Element for you
my $elem = $appium->find_element('test', 'id');
$elem->click;
=head1 NEW OR UPDATED FUNCTIONALITY
=head2 Contexts
Instead of using windows to manage switching between native
applications and webviews, use the analogous context methods:
my $current = $appium->current_context;
my @contexts = $appium->contexts;
my $context = 'WEBVIEW_1'
$appium->switch_to->context( $context );
=head2 Finding Elements
There are different strategies available for finding elements in
Appium. The options for strategies in a native application are:
id
name
xpath
class|class_name
accessibility_id
ios|ios_uiautomation
android|android_uiautomator
If you're testing a mobile browser like Chrome or Safari, you'll have
access to the same set of finders as in Webdriver:
class
class_name
css
id
link
link_text
name
partial_link_text
tag_name
xpath
Here are some examples of using the Appium specific strategies:
# iOS UIAutomation
( run in 1.300 second using v1.01-cache-2.11-cpan-63c85eba8c4 )