Skip to content

Commit 61839ea

Browse files
committed
Add get_property for W3C / Selenium3 compatibility
1 parent 2dfc929 commit 61839ea

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
** 0.08 / 2018-03-21
2+
- Add get_property for W3C / Selenium3 compatibility
3+
14
** 0.06 / 2016-10-03
25
- Make 'get_page_source' write info a file
36

lib/Weasel/Driver/Selenium2.pm

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Weasel::Driver::Selenium2 - Weasel driver wrapping Selenium::Remote::Driver
55
66
=head1 VERSION
77
8-
0.06
8+
0.08
99
1010
=head1 SYNOPSIS
1111
@@ -52,7 +52,7 @@ use Weasel::DriverRole;
5252
use Moose;
5353
with 'Weasel::DriverRole';
5454

55-
our $VERSION = '0.06';
55+
our $VERSION = '0.08';
5656

5757

5858
=head1 ATTRIBUTES
@@ -123,13 +123,14 @@ see L<Weasel::DriverRole>.
123123
=cut
124124

125125
sub implements {
126-
return '0.02';
126+
return '0.03';
127127
}
128128

129129
=item start
130130
131131
A few capabilities can be specified in t/.pherkin.yaml
132132
Some can even be specified as environment variables, they will be expanded here if present.
133+
Revised for Selenium3. See https://github.com/teodesian/Selenium-Remote-Driver#no-standalone-server
133134
134135
=cut
135136

@@ -268,7 +269,21 @@ sub execute_script {
268269
sub get_attribute {
269270
my ($self, $id, $att) = @_;
270271

271-
return $self->_resolve_id($id)->get_attribute($att);
272+
return $self->_resolve_id($id)->get_attribute($att, 1);
273+
}
274+
275+
=item get_property($id, $prop_name)
276+
277+
With Selenium 2, the method WebElement.GetAttribute(...) returned the HTMLElement
278+
property when present and the attribute otherwise.
279+
The methods are separated in Selenium 3
280+
281+
=cut
282+
283+
sub get_property {
284+
my ($self, $id, $property) = @_;
285+
286+
return $self->_resolve_id($id)->get_property($property);
272287
}
273288

274289
=item get_page_source($fh)

0 commit comments

Comments
 (0)