The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Weasel::Driver::Selenium2 - Weasel driver wrapping Selenium::Remote::Driver

VERSION

0.03

SYNOPSIS

  use Weasel;
  use Weasel::Session;
  use Weasel::Driver::Selenium2;

  my %opts = (
    wait_timeout => 3000,    # 3000 msec == 3s
    window_size => '1024x1280',
    caps => {
      port => 4444,
      # ... and other Selenium::Remote::Driver capabilities options
    },
  );
  my $weasel = Weasel->new(
       default_session => 'default',
       sessions => {
          default => Weasel::Session->new(
            driver => Weasel::Driver::Selenium2->new(%opts),
          ),
       });

  $weasel->session->get('http://localhost/index');

DESCRIPTION

This module implements the Weasel::DriverRole protocol, wrapping Selenium::Remote::Driver.

ATTRIBUTES

_driver

Internal. Holds the reference to the Selenium::Remote::Driver instance.

wait_timeout

The number of miliseconds to wait before failing to find a tag or completing a wait condition, turns into an error.

Change by calling set_wait_timeout.

window_size

String holding '<height>x<width>', the window size to be used. E.g., to set the window size to 1280(wide) by 1024(high), set to: '1024x1280'.

Change by calling set_window_size.

caps

Capabilities to be passed to the Selenium::Remote::Driver constructor when start is being called. Changes won't take effect until the session is stopped and started or restarted.

IMPLEMENTATION OF Weasel::DriverRole

For the documentation of the methods in this section, see Weasel::DriverRole.

implements
start

A few capabilities can be specified in t/.pherkin.yaml Some can even be specified as environment variables, they will be expanded here if present.

stop
find_all
get
wait_for
clear
click
dblclick
execute_script
get_attribute($id, $att_name)
get_text($id)
is_displayed($id)
set_attribute($id, $att_name, $value)
get_selected($id)
set_selected($id, $value)
get_page_source($fh)
screenshot($fh)
send_keys($element_id, @keys)
tag_name($elem)

METHODS

This module implements the following methods in addition to the Weasel::DriverRole protocol methods:

set_wait_timeout

Sets the wait_timeut attribute of the object as well as of the Selenium::Remote::Driver object, if a session has been started.

set_window_size

Sets the window_size attribute of the object as well as the window size of the currently active window of the Selenium::Remote::Driver object, if a session has been started.

CONTRIBUTORS

Erik Huelsmann

MAINTAINERS

Erik Huelsmann

BUGS

Bugs can be filed in the GitHub issue tracker for the Weasel project: https://github.com/perl-weasel/weasel-driver-selenium2/issues

SOURCE

The source code repository for Weasel is at https://github.com/perl-weasel/weasel-driver-selenium2

SUPPORT

Community support is available through perl-weasel@googlegroups.com.

COPYRIGHT

 (C) 2016  Erik Huelsmann

Licensed under the same terms as Perl.