Skip to content

Commit 9d7c128

Browse files
committed
Add get_property for W3C / Selenium3 compatibility
1 parent 2dfc929 commit 9d7c128

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
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: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)