lib/WWW/Selenium.pm

filter: Statementstmt 94.8% 425 / 448 Branchbran 63.5% 47 / 74 Conditioncond 91.6% 11 / 12 MC/DCmcdc 71.4% 5 / 7 Subroutinesub 98.2% 168 / 171 Podpod 93.8% 152 / 162 totaltotal 92.4% 808 / 874 CC 42 SCAR 10.4
CC
42
Cov
90%
get_boolean_array
20.0
do_command
15.8
pause
6.0
CRAP 2.8
« lib/WWW/Selenium/Util.pm ↑ Summary blib/lib/Devel/REPL/Plugin/Selenium.pm »
1 # Copyright 2006 ThoughtWorks, Inc
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15  
16 package WWW::Selenium;
17 {
18 12 $WWW::Selenium::VERSION = '1.36';
19 }
20 # ABSTRACT: Perl Client for the Selenium Remote Control test tool
21  
22 12 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 12 ▶use HTTP::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 12 ▶use HTTP::Headers;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 12 ▶use URI::Escape;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 12 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
27 12 ▶use Time::HiRes qw(sleep);
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32  
33 ### This next part is auto-generated based on the big comment in selenium-api.js
34  
35 #Defines an object that runs Selenium commands.
36  
37  
38 12 eval 'require Encode';
39 12 my $encode_present = !$@;
40 12 ▶Encode->import('decode_utf8') if $encode_present;
Branch: 1 branch
BranchTrueFalseTotal
if $encode_present 12 0 12
41  
42  
43 32 ▶sub new {
Subroutine new: called CC=5 SCAR=16.2
Pod documented
44 32 my ($class, %args) = @_;
45 my $self = { # default args:
46 host => 'localhost',
47 port => 4444,
48 auto_stop => 1,
49 32 ▶ browser_start_command => delete $args{browser} || '*firefox',
Condition100%2/2
delete $args{'browser'} || '*firefox'
l!l
1121
MC/DC100%1/1
delete $args{'browser'} || '*firefox'
delete $args{'browser'}
Truth table100%2/2
A
A= delete $args{'browser'}
Aresult
11
00
50 _ua => undef,
51 keep_alive => 5,
52 http_method => 'POST',
53 %args,
54 };
55 32 ▶ croak 'browser_url is mandatory!' unless $self->{browser_url};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"browser_url"} 1 31 32
56 croak "Unknown http_method: ($self->{http_method})"
57 31 ▶ unless $self->{http_method} =~ m/^GET|POST$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"http_method"} =~ /^GET|POST$/ 0 31 31
58 31 ▶ bless $self, $class or die "Can't bless $class: $!";
Branch: 1 branch
BranchTrueFalseTotal
bless $self, $class or die "Can't bless ${class}: $!" 31 0 31
59 31 return $self;
60 }
61  
62 32 ▶sub start {
Subroutine start: called CC=2 SCAR=6.9
Pod undocumented
63 32 my $self = shift;
64 32 ▶ return if $self->{session_id};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"session_id"} 3 29 32
65 $self->{session_id} = $self->get_string("getNewBrowserSession",
66 $self->{browser_start_command},
67 29 $self->{browser_url});
68 }
69  
70 35 ▶sub stop {
Subroutine stop: called CC=2 SCAR=6.9
Pod undocumented
71 35 my $self = shift;
72 35 ▶ return unless defined $self->{session_id};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"session_id"} 7 28 35
73 28 $self->do_command("testComplete");
74 28 $self->{session_id} = undef;
75 }
76  
77 303 ▶sub do_command {
Subroutine do_command: called CC=15 SCAR=27.6
Pod undocumented
78 303 my ($self, $command, @args) = @_;
79 303 my $get = $self->{http_method} eq 'GET';
80  
81 303 ▶ $self->{_page_opened} = 1 if $command eq 'open';
Branch: 1 branch
BranchTrueFalseTotal
if $command eq "open" 24 279 303
82  
83 # Check that user has called open()
84 303 my %valid_pre_open_commands = (
85 testComplete => 1,
86 getNewBrowserSession => 1,
87 setTimeout => 1,
88 );
89 303 ▶ if (!$self->{_page_opened} and !$valid_pre_open_commands{$command}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_page_opened"} or $valid_pre_open_commands{$command}) 1 302 303
Condition100%3/3
$self->{"_page_opened"} or $valid_pre_open_commands{$command}
l!l&&r!l&&!r
265371
MC/DC100%2/2
$self->{"_page_opened"} or $valid_pre_open_commands{$command}
$self->{"_page_opened"} $valid_pre_open_commands{$command}
Truth table100%3/3
A or B
A= $self->{"_page_opened"}B= $valid_pre_open_commands{$command}
ABresult
1X1
011
000
90 1 die "You must open a page before calling $command. eg: \$sel->open('/');\n";
91 }
92  
93 302 my $fullurl = "http://$self->{host}:$self->{port}/selenium-server/driver/";
94 302 ▶ $fullurl .= '?' if $get;
Branch: 1 branch
BranchTrueFalseTotal
if $get 0 302 302
95 302 my $content = '';
96  
97 302 my $i = 1;
98 302 @args = grep defined, @args;
99 302 ▶ my $params = $get ? \$fullurl : \$content;
Branch: 1 branch
BranchTrueFalseTotal
$get ? : 0 302 302
100 302 $$params .= "cmd=" . uri_escape($command);
101 302 ▶ while (@args) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args) 428 302 730
102 428 $$params .= '&' . $i++ . '=' . URI::Escape::uri_escape_utf8(shift @args);
103 }
104 302 ▶ if (defined $self->{session_id}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"session_id"}) 273 29 302
105 273 $$params .= "&sessionId=$self->{session_id}";
106 }
107 # We use the full version of LWP to make sure we issue an
108 # HTTP 1.1 request (SRC-25)
109  
110 302 ▶ my $method = $get ? 'GET' : 'POST';
Branch: 1 branch
BranchTrueFalseTotal
$get ? : 0 302 302
111 302 ▶ print "---> Requesting $method $fullurl ($content)\n" if $self->{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"verbose"} 0 302 302
112 302 ▶ my $header = HTTP::Headers->new(
Branch: 1 branch
BranchTrueFalseTotal
$get ? : 0 302 302
113 $get ? () : (
114 Content_Type => 'application/x-www-form-urlencoded; charset=utf-8'
115 )
116 );
117 302 my $response = $self->ua->request(
118 HTTP::Request->new($method => $fullurl, $header, $content) );
119 302 my $result;
120 302 ▶ if ($response->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 302 0 302
121 302 $result = $response->content;
122 302 ▶ print "Got result: $result\n" if $self->{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"verbose"} 0 302 302
123 }
124 else {
125 0 die "Error requesting $fullurl:\n" . $response->status_line . "\n";
126 }
127 302 ▶ $result = decode_utf8($result) if $encode_present;
Branch: 1 branch
BranchTrueFalseTotal
if $encode_present 302 0 302
128 302 ▶ die "Error requesting $fullurl:\n$result\n" unless $result =~ /^OK/;
Branch: 1 branch
BranchTrueFalseTotal
unless $result =~ /^OK/ 5 297 302
129 297 return $result;
130 }
131  
132 313 ▶sub ua {
Subroutine ua: called CC=3 SCAR=11.0
Pod undocumented
133 313 my $self = shift;
134  
135 313 ▶ $self->{_ua} ||= LWP::UserAgent->new(keep_alive => $self->{keep_alive});
Condition66%2/3
$self->{"_ua"} ||= "LWP::UserAgent"->new("keep_alive", $self->{"keep_alive"})
l!l&&r!l&&!r
283300
MC/DC0%0/2
$self->{"_ua"} ||= "LWP::UserAgent"->new("keep_alive", $self->{"keep_alive"})
$self->{"_ua"} "LWP::UserAgent"->new("keep_alive", $self->{"keep_alive"})
Truth table66%2/3
A ||= B
A= $self->{"_ua"}B= "LWP::UserAgent"->new("keep_alive", $self->{"keep_alive"})
ABresult
1X1
011
000
136  
137 313 ▶ if (my $msec = $self->{_timeout}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $msec = $self->{"_timeout"}) 37 276 313
138 # Keep the 3 minute timeout (LWP::UserAgent default) on top of the
139 # selenium timeout
140 37 $self->{_ua}->timeout( int($msec/1000 + 180) );
141 }
142 313 return $self->{_ua};
143 }
144  
145 156 ▶sub get_string {
Subroutine get_string: called CC=1 SCAR=0.0
Pod undocumented
146 156 my $self = shift;
147 156 my $result = $self->do_command(@_);
148 151 return substr($result, 3);
149 }
150  
151 30 ▶sub get_string_array {
Subroutine get_string_array: called CC=4 SCAR=13.9
Pod undocumented
152 30 my $self = shift;
153 30 my $result = $self->get_string(@_);
154 29 my $token = "";
155 29 my @tokens = ();
156 29 my @chars = split(//, $result);
157 29 ▶ for (my $i = 0; $i < @chars; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @chars) 306 29 335
158 306 my $char = $chars[$i];
159 306 ▶ if ($char eq '\\') {
Branch: 2 branches
BranchTrueFalseTotal
if ($char eq '\\') { } 12 294 306
elsif ($char eq ',') { } 16 278 294
160 12 $i++;
161 12 $char = $chars[$i];
162 12 $token .= $char;
163 } elsif ($char eq ',') {
164 16 push (@tokens, $token);
165 16 $token = "";
166 } else {
167 278 $token .= $char;
168 }
169 }
170 29 push (@tokens, $token);
171 29 return @tokens;
172 }
173  
174 8 ▶sub get_number {
Subroutine get_number: called CC=1 SCAR=0.0
Pod undocumented
175 8 my $self = shift;
176 8 my $result = $self->get_string(@_);
177 # Is there something else I need to do here?
178 8 return $result;
179 }
180  
181 0 ▶sub get_number_array {
Subroutine get_number_array: not called CC=1 SCAR=6.9
Pod undocumented
182 0 my $self = shift;
183 0 my @result = $self->get_string_array(@_);
184 # Is there something else I need to do here?
185 0 return @result;
186 }
187  
188 13 ▶sub get_boolean {
Subroutine get_boolean: called CC=3 SCAR=15.0
Pod undocumented
189 13 my $self = shift;
190 13 my $result = $self->get_string(@_);
191 13 ▶ if ($result eq "true") {
Branch: 1 branch
BranchTrueFalseTotal
if ($result eq "true") 13 0 13
192 13 return 1;
193 }
194 0 ▶ if ($result eq "false") {
Branch: 1 branch
BranchTrueFalseTotal
if ($result eq "false") 0 0 0
195 0 return 0;
196 }
197 0 die "result is neither 'true' nor 'false': $result";
198 }
199  
200 0 ▶sub get_boolean_array {
Subroutine get_boolean_array: not called CC=4 SCAR=30.0
Pod undocumented
201 0 my $self = shift;
202 0 my @result = $self->get_string_array(@_);
203 0 my @boolarr = ();
204 0 ▶ for (my $i = 0; $i < @result; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @result) 0 0 0
205 0 ▶ if ($result[$i] eq "true") {
Branch: 1 branch
BranchTrueFalseTotal
if ($result[$i] eq "true") 0 0 0
206 0 push (@boolarr, 1);
207 0 next;
208 }
209 0 ▶ if ($result[$i] eq "false") {
Branch: 1 branch
BranchTrueFalseTotal
if ($result[$i] eq "false") 0 0 0
210 0 push (@boolarr, 0);
211 0 next;
212 }
213 0 die "result is neither 'true' nor 'false': ". $result[$i];
214 }
215 0 return @boolarr;
216 }
217  
218  
219 0 ▶sub pause {
Subroutine pause: not called CC=2 SCAR=17.9
Pod documented
220 0 my ($self,$timeout) = @_;
221 0 ▶ $timeout = 1000 unless defined $timeout;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $timeout 0 0 0
222 0 $timeout /= 1000;
223 0 sleep $timeout;
224 }
225  
226 ### From here on, everything's auto-generated from XML
227  
228  
229 6 ▶sub click {
Subroutine click: called CC=1 SCAR=0.0
Pod documented
230 6 my $self = shift;
231 6 $self->do_command("click", @_);
232 }
233  
234  
235 1 ▶sub double_click {
Subroutine double_click: called CC=1 SCAR=0.0
Pod documented
236 1 my $self = shift;
237 1 $self->do_command("doubleClick", @_);
238 }
239  
240  
241 1 ▶sub context_menu {
Subroutine context_menu: called CC=1 SCAR=0.0
Pod documented
242 1 my $self = shift;
243 1 $self->do_command("contextMenu", @_);
244 }
245  
246  
247 1 ▶sub click_at {
Subroutine click_at: called CC=1 SCAR=0.0
Pod documented
248 1 my $self = shift;
249 1 $self->do_command("clickAt", @_);
250 }
251  
252  
253 1 ▶sub double_click_at {
Subroutine double_click_at: called CC=1 SCAR=0.0
Pod documented
254 1 my $self = shift;
255 1 $self->do_command("doubleClickAt", @_);
256 }
257  
258  
259 1 ▶sub context_menu_at {
Subroutine context_menu_at: called CC=1 SCAR=0.0
Pod documented
260 1 my $self = shift;
261 1 $self->do_command("contextMenuAt", @_);
262 }
263  
264  
265 1 ▶sub fire_event {
Subroutine fire_event: called CC=1 SCAR=0.0
Pod documented
266 1 my $self = shift;
267 1 $self->do_command("fireEvent", @_);
268 }
269  
270  
271 1 ▶sub focus {
Subroutine focus: called CC=1 SCAR=0.0
Pod documented
272 1 my $self = shift;
273 1 $self->do_command("focus", @_);
274 }
275  
276  
277 1 ▶sub key_press {
Subroutine key_press: called CC=1 SCAR=0.0
Pod documented
278 1 my $self = shift;
279 1 $self->do_command("keyPress", @_);
280 }
281  
282  
283 1 ▶sub shift_key_down {
Subroutine shift_key_down: called CC=1 SCAR=0.0
Pod documented
284 1 my $self = shift;
285 1 $self->do_command("shiftKeyDown", @_);
286 }
287  
288  
289 1 ▶sub shift_key_up {
Subroutine shift_key_up: called CC=1 SCAR=0.0
Pod documented
290 1 my $self = shift;
291 1 $self->do_command("shiftKeyUp", @_);
292 }
293  
294  
295 1 ▶sub meta_key_down {
Subroutine meta_key_down: called CC=1 SCAR=0.0
Pod documented
296 1 my $self = shift;
297 1 $self->do_command("metaKeyDown", @_);
298 }
299  
300  
301 1 ▶sub meta_key_up {
Subroutine meta_key_up: called CC=1 SCAR=0.0
Pod documented
302 1 my $self = shift;
303 1 $self->do_command("metaKeyUp", @_);
304 }
305  
306  
307 1 ▶sub alt_key_down {
Subroutine alt_key_down: called CC=1 SCAR=0.0
Pod documented
308 1 my $self = shift;
309 1 $self->do_command("altKeyDown", @_);
310 }
311  
312  
313 1 ▶sub alt_key_up {
Subroutine alt_key_up: called CC=1 SCAR=0.0
Pod documented
314 1 my $self = shift;
315 1 $self->do_command("altKeyUp", @_);
316 }
317  
318  
319 1 ▶sub control_key_down {
Subroutine control_key_down: called CC=1 SCAR=0.0
Pod documented
320 1 my $self = shift;
321 1 $self->do_command("controlKeyDown", @_);
322 }
323  
324  
325 1 ▶sub control_key_up {
Subroutine control_key_up: called CC=1 SCAR=0.0
Pod documented
326 1 my $self = shift;
327 1 $self->do_command("controlKeyUp", @_);
328 }
329  
330  
331 1 ▶sub key_down {
Subroutine key_down: called CC=1 SCAR=0.0
Pod documented
332 1 my $self = shift;
333 1 $self->do_command("keyDown", @_);
334 }
335  
336  
337 1 ▶sub key_up {
Subroutine key_up: called CC=1 SCAR=0.0
Pod documented
338 1 my $self = shift;
339 1 $self->do_command("keyUp", @_);
340 }
341  
342  
343 1 ▶sub mouse_over {
Subroutine mouse_over: called CC=1 SCAR=0.0
Pod documented
344 1 my $self = shift;
345 1 $self->do_command("mouseOver", @_);
346 }
347  
348  
349 1 ▶sub mouse_out {
Subroutine mouse_out: called CC=1 SCAR=0.0
Pod documented
350 1 my $self = shift;
351 1 $self->do_command("mouseOut", @_);
352 }
353  
354  
355 1 ▶sub mouse_down {
Subroutine mouse_down: called CC=1 SCAR=0.0
Pod documented
356 1 my $self = shift;
357 1 $self->do_command("mouseDown", @_);
358 }
359  
360  
361 1 ▶sub mouse_down_right {
Subroutine mouse_down_right: called CC=1 SCAR=0.0
Pod documented
362 1 my $self = shift;
363 1 $self->do_command("mouseDownRight", @_);
364 }
365  
366  
367 1 ▶sub mouse_down_at {
Subroutine mouse_down_at: called CC=1 SCAR=0.0
Pod documented
368 1 my $self = shift;
369 1 $self->do_command("mouseDownAt", @_);
370 }
371  
372  
373 1 ▶sub mouse_down_right_at {
Subroutine mouse_down_right_at: called CC=1 SCAR=0.0
Pod documented
374 1 my $self = shift;
375 1 $self->do_command("mouseDownRightAt", @_);
376 }
377  
378  
379 1 ▶sub mouse_up {
Subroutine mouse_up: called CC=1 SCAR=0.0
Pod documented
380 1 my $self = shift;
381 1 $self->do_command("mouseUp", @_);
382 }
383  
384  
385 1 ▶sub mouse_up_right {
Subroutine mouse_up_right: called CC=1 SCAR=0.0
Pod documented
386 1 my $self = shift;
387 1 $self->do_command("mouseUpRight", @_);
388 }
389  
390  
391 1 ▶sub mouse_up_at {
Subroutine mouse_up_at: called CC=1 SCAR=0.0
Pod documented
392 1 my $self = shift;
393 1 $self->do_command("mouseUpAt", @_);
394 }
395  
396  
397 1 ▶sub mouse_up_right_at {
Subroutine mouse_up_right_at: called CC=1 SCAR=0.0
Pod documented
398 1 my $self = shift;
399 1 $self->do_command("mouseUpRightAt", @_);
400 }
401  
402  
403 1 ▶sub mouse_move {
Subroutine mouse_move: called CC=1 SCAR=0.0
Pod documented
404 1 my $self = shift;
405 1 $self->do_command("mouseMove", @_);
406 }
407  
408  
409 1 ▶sub mouse_move_at {
Subroutine mouse_move_at: called CC=1 SCAR=0.0
Pod documented
410 1 my $self = shift;
411 1 $self->do_command("mouseMoveAt", @_);
412 }
413  
414  
415 1 ▶sub type {
Subroutine type: called CC=1 SCAR=0.0
Pod documented
416 1 my $self = shift;
417 1 $self->do_command("type", @_);
418 }
419  
420  
421 1 ▶sub type_keys {
Subroutine type_keys: called CC=1 SCAR=0.0
Pod documented
422 1 my $self = shift;
423 1 $self->do_command("typeKeys", @_);
424 }
425  
426  
427 1 ▶sub set_speed {
Subroutine set_speed: called CC=1 SCAR=0.0
Pod documented
428 1 my $self = shift;
429 1 $self->do_command("setSpeed", @_);
430 }
431  
432  
433 1 ▶sub get_speed {
Subroutine get_speed: called CC=1 SCAR=0.0
Pod documented
434 1 my $self = shift;
435 1 return $self->get_string("getSpeed", @_);
436 }
437  
438  
439 1 ▶sub check {
Subroutine check: called CC=1 SCAR=0.0
Pod documented
440 1 my $self = shift;
441 1 $self->do_command("check", @_);
442 }
443  
444  
445 1 ▶sub uncheck {
Subroutine uncheck: called CC=1 SCAR=0.0
Pod documented
446 1 my $self = shift;
447 1 $self->do_command("uncheck", @_);
448 }
449  
450  
451 1 ▶sub select {
Subroutine select: called CC=1 SCAR=0.0
Pod documented
452 1 my $self = shift;
453 1 $self->do_command("select", @_);
454 }
455  
456  
457 1 ▶sub add_selection {
Subroutine add_selection: called CC=1 SCAR=0.0
Pod documented
458 1 my $self = shift;
459 1 $self->do_command("addSelection", @_);
460 }
461  
462  
463 1 ▶sub remove_selection {
Subroutine remove_selection: called CC=1 SCAR=0.0
Pod documented
464 1 my $self = shift;
465 1 $self->do_command("removeSelection", @_);
466 }
467  
468  
469 1 ▶sub remove_all_selections {
Subroutine remove_all_selections: called CC=1 SCAR=0.0
Pod documented
470 1 my $self = shift;
471 1 $self->do_command("removeAllSelections", @_);
472 }
473  
474  
475 1 ▶sub submit {
Subroutine submit: called CC=1 SCAR=0.0
Pod documented
476 1 my $self = shift;
477 1 $self->do_command("submit", @_);
478 }
479  
480  
481 23 ▶sub open {
Subroutine open: called CC=2 SCAR=6.9
Pod documented
482 23 my $self = shift;
483 23 ▶ $_[0] ||= '/'; # default to opening site root
Condition100%2/2
$_[0] ||= "/"
l!l
320
MC/DC100%1/1
$_[0] ||= "/"
$_[0]
Truth table100%2/2
A
A= $_[0]
Aresult
11
00
484  
485 23 $self->do_command("open", @_);
486 }
487  
488  
489 1 ▶sub open_window {
Subroutine open_window: called CC=1 SCAR=0.0
Pod documented
490 1 my $self = shift;
491 1 $self->do_command("openWindow", @_);
492 }
493  
494  
495 1 ▶sub select_window {
Subroutine select_window: called CC=1 SCAR=0.0
Pod documented
496 1 my $self = shift;
497 1 $self->do_command("selectWindow", @_);
498 }
499  
500  
501 1 ▶sub select_pop_up {
Subroutine select_pop_up: called CC=1 SCAR=0.0
Pod documented
502 1 my $self = shift;
503 1 $self->do_command("selectPopUp", @_);
504 }
505  
506  
507 1 ▶sub deselect_pop_up {
Subroutine deselect_pop_up: called CC=1 SCAR=0.0
Pod documented
508 1 my $self = shift;
509 1 $self->do_command("deselectPopUp", @_);
510 }
511  
512  
513 1 ▶sub select_frame {
Subroutine select_frame: called CC=1 SCAR=0.0
Pod documented
514 1 my $self = shift;
515 1 $self->do_command("selectFrame", @_);
516 }
517  
518  
519 1 ▶sub get_whether_this_frame_match_frame_expression {
Subroutine get_whether_this_frame_match_frame_expression: called CC=1 SCAR=0.0
Pod documented
520 1 my $self = shift;
521 1 return $self->get_boolean("getWhetherThisFrameMatchFrameExpression", @_);
522 }
523  
524  
525 1 ▶sub get_whether_this_window_match_window_expression {
Subroutine get_whether_this_window_match_window_expression: called CC=1 SCAR=0.0
Pod documented
526 1 my $self = shift;
527 1 return $self->get_boolean("getWhetherThisWindowMatchWindowExpression", @_);
528 }
529  
530  
531 1 ▶sub wait_for_pop_up {
Subroutine wait_for_pop_up: called CC=1 SCAR=0.0
Pod documented
532 1 my $self = shift;
533 1 local $self->{_timeout} = $_[1];
534  
535 1 $self->do_command("waitForPopUp", @_);
536 }
537  
538  
539 1 ▶sub choose_cancel_on_next_confirmation {
Subroutine choose_cancel_on_next_confirmation: called CC=1 SCAR=0.0
Pod documented
540 1 my $self = shift;
541 1 $self->do_command("chooseCancelOnNextConfirmation", @_);
542 }
543  
544  
545 1 ▶sub choose_ok_on_next_confirmation {
Subroutine choose_ok_on_next_confirmation: called CC=1 SCAR=0.0
Pod documented
546 1 my $self = shift;
547 1 $self->do_command("chooseOkOnNextConfirmation", @_);
548 }
549  
550  
551 1 ▶sub answer_on_next_prompt {
Subroutine answer_on_next_prompt: called CC=1 SCAR=0.0
Pod documented
552 1 my $self = shift;
553 1 $self->do_command("answerOnNextPrompt", @_);
554 }
555  
556  
557 1 ▶sub go_back {
Subroutine go_back: called CC=1 SCAR=0.0
Pod documented
558 1 my $self = shift;
559 1 $self->do_command("goBack", @_);
560 }
561  
562  
563 1 ▶sub refresh {
Subroutine refresh: called CC=1 SCAR=0.0
Pod documented
564 1 my $self = shift;
565 1 $self->do_command("refresh", @_);
566 }
567  
568  
569 1 ▶sub close {
Subroutine close: called CC=1 SCAR=0.0
Pod documented
570 1 my $self = shift;
571 1 $self->do_command("close", @_);
572 }
573  
574  
575 1 ▶sub is_alert_present {
Subroutine is_alert_present: called CC=1 SCAR=0.0
Pod documented
576 1 my $self = shift;
577 1 return $self->get_boolean("isAlertPresent", @_);
578 }
579  
580  
581 1 ▶sub is_prompt_present {
Subroutine is_prompt_present: called CC=1 SCAR=0.0
Pod documented
582 1 my $self = shift;
583 1 return $self->get_boolean("isPromptPresent", @_);
584 }
585  
586  
587 1 ▶sub is_confirmation_present {
Subroutine is_confirmation_present: called CC=1 SCAR=0.0
Pod documented
588 1 my $self = shift;
589 1 return $self->get_boolean("isConfirmationPresent", @_);
590 }
591  
592  
593 3 ▶sub get_alert {
Subroutine get_alert: called CC=1 SCAR=0.0
Pod documented
594 3 my $self = shift;
595 3 return $self->get_string("getAlert", @_);
596 }
597  
598  
599 1 ▶sub get_confirmation {
Subroutine get_confirmation: called CC=1 SCAR=0.0
Pod documented
600 1 my $self = shift;
601 1 return $self->get_string("getConfirmation", @_);
602 }
603  
604  
605 3 ▶sub get_prompt {
Subroutine get_prompt: called CC=1 SCAR=0.0
Pod documented
606 3 my $self = shift;
607 3 return $self->get_string("getPrompt", @_);
608 }
609  
610  
611 11 ▶sub get_location {
Subroutine get_location: called CC=1 SCAR=0.0
Pod documented
612 11 my $self = shift;
613 11 return $self->get_string("getLocation", @_);
614 }
615  
616  
617 7 ▶sub get_title {
Subroutine get_title: called CC=1 SCAR=0.0
Pod documented
618 7 my $self = shift;
619 7 return $self->get_string("getTitle", @_);
620 }
621  
622  
623 1 ▶sub get_body_text {
Subroutine get_body_text: called CC=1 SCAR=0.0
Pod documented
624 1 my $self = shift;
625 1 return $self->get_string("getBodyText", @_);
626 }
627  
628  
629 1 ▶sub get_value {
Subroutine get_value: called CC=1 SCAR=0.0
Pod documented
630 1 my $self = shift;
631 1 return $self->get_string("getValue", @_);
632 }
633  
634  
635 25 ▶sub get_text {
Subroutine get_text: called CC=1 SCAR=0.0
Pod documented
636 25 my $self = shift;
637 25 return $self->get_string("getText", @_);
638 }
639  
640  
641 1 ▶sub highlight {
Subroutine highlight: called CC=1 SCAR=0.0
Pod documented
642 1 my $self = shift;
643 1 $self->do_command("highlight", @_);
644 }
645  
646  
647 1 ▶sub get_eval {
Subroutine get_eval: called CC=1 SCAR=0.0
Pod documented
648 1 my $self = shift;
649 1 return $self->get_string("getEval", @_);
650 }
651  
652  
653 1 ▶sub is_checked {
Subroutine is_checked: called CC=1 SCAR=0.0
Pod documented
654 1 my $self = shift;
655 1 return $self->get_boolean("isChecked", @_);
656 }
657  
658  
659 1 ▶sub get_table {
Subroutine get_table: called CC=1 SCAR=0.0
Pod documented
660 1 my $self = shift;
661 1 return $self->get_string("getTable", @_);
662 }
663  
664  
665 5 ▶sub get_selected_labels {
Subroutine get_selected_labels: called CC=1 SCAR=0.0
Pod documented
666 5 my $self = shift;
667 5 return $self->get_string_array("getSelectedLabels", @_);
668 }
669  
670  
671 1 ▶sub get_selected_label {
Subroutine get_selected_label: called CC=1 SCAR=0.0
Pod documented
672 1 my $self = shift;
673 1 return $self->get_string("getSelectedLabel", @_);
674 }
675  
676  
677 3 ▶sub get_selected_values {
Subroutine get_selected_values: called CC=1 SCAR=0.0
Pod documented
678 3 my $self = shift;
679 3 return $self->get_string_array("getSelectedValues", @_);
680 }
681  
682  
683 1 ▶sub get_selected_value {
Subroutine get_selected_value: called CC=1 SCAR=0.0
Pod documented
684 1 my $self = shift;
685 1 return $self->get_string("getSelectedValue", @_);
686 }
687  
688  
689 3 ▶sub get_selected_indexes {
Subroutine get_selected_indexes: called CC=1 SCAR=0.0
Pod documented
690 3 my $self = shift;
691 3 return $self->get_string_array("getSelectedIndexes", @_);
692 }
693  
694  
695 1 ▶sub get_selected_index {
Subroutine get_selected_index: called CC=1 SCAR=0.0
Pod documented
696 1 my $self = shift;
697 1 return $self->get_string("getSelectedIndex", @_);
698 }
699  
700  
701 2 ▶sub get_selected_ids {
Subroutine get_selected_ids: called CC=1 SCAR=0.0
Pod documented
702 2 my $self = shift;
703 2 return $self->get_string_array("getSelectedIds", @_);
704 }
705  
706  
707 1 ▶sub get_selected_id {
Subroutine get_selected_id: called CC=1 SCAR=0.0
Pod documented
708 1 my $self = shift;
709 1 return $self->get_string("getSelectedId", @_);
710 }
711  
712  
713 1 ▶sub is_something_selected {
Subroutine is_something_selected: called CC=1 SCAR=0.0
Pod documented
714 1 my $self = shift;
715 1 return $self->get_boolean("isSomethingSelected", @_);
716 }
717  
718  
719 1 ▶sub get_select_options {
Subroutine get_select_options: called CC=1 SCAR=0.0
Pod documented
720 1 my $self = shift;
721 1 return $self->get_string_array("getSelectOptions", @_);
722 }
723  
724  
725 1 ▶sub get_attribute {
Subroutine get_attribute: called CC=1 SCAR=0.0
Pod documented
726 1 my $self = shift;
727 1 return $self->get_string("getAttribute", @_);
728 }
729  
730  
731 1 ▶sub is_text_present {
Subroutine is_text_present: called CC=1 SCAR=0.0
Pod documented
732 1 my $self = shift;
733 1 return $self->get_boolean("isTextPresent", @_);
734 }
735  
736  
737 1 ▶sub is_element_present {
Subroutine is_element_present: called CC=1 SCAR=0.0
Pod documented
738 1 my $self = shift;
739 1 return $self->get_boolean("isElementPresent", @_);
740 }
741  
742  
743 1 ▶sub is_visible {
Subroutine is_visible: called CC=1 SCAR=0.0
Pod documented
744 1 my $self = shift;
745 1 return $self->get_boolean("isVisible", @_);
746 }
747  
748  
749 1 ▶sub is_editable {
Subroutine is_editable: called CC=1 SCAR=0.0
Pod documented
750 1 my $self = shift;
751 1 return $self->get_boolean("isEditable", @_);
752 }
753  
754  
755 1 ▶sub get_all_buttons {
Subroutine get_all_buttons: called CC=1 SCAR=0.0
Pod documented
756 1 my $self = shift;
757 1 return $self->get_string_array("getAllButtons", @_);
758 }
759  
760  
761 1 ▶sub get_all_links {
Subroutine get_all_links: called CC=1 SCAR=0.0
Pod documented
762 1 my $self = shift;
763 1 return $self->get_string_array("getAllLinks", @_);
764 }
765  
766  
767 6 ▶sub get_all_fields {
Subroutine get_all_fields: called CC=1 SCAR=0.0
Pod documented
768 6 my $self = shift;
769 6 return $self->get_string_array("getAllFields", @_);
770 }
771  
772  
773 1 ▶sub get_attribute_from_all_windows {
Subroutine get_attribute_from_all_windows: called CC=1 SCAR=0.0
Pod documented
774 1 my $self = shift;
775 1 return $self->get_string_array("getAttributeFromAllWindows", @_);
776 }
777  
778  
779 1 ▶sub dragdrop {
Subroutine dragdrop: called CC=1 SCAR=0.0
Pod documented
780 1 my $self = shift;
781 1 $self->do_command("dragdrop", @_);
782 }
783  
784  
785 1 ▶sub set_mouse_speed {
Subroutine set_mouse_speed: called CC=1 SCAR=0.0
Pod documented
786 1 my $self = shift;
787 1 $self->do_command("setMouseSpeed", @_);
788 }
789  
790  
791 1 ▶sub get_mouse_speed {
Subroutine get_mouse_speed: called CC=1 SCAR=0.0
Pod documented
792 1 my $self = shift;
793 1 return $self->get_number("getMouseSpeed", @_);
794 }
795  
796  
797 1 ▶sub drag_and_drop {
Subroutine drag_and_drop: called CC=1 SCAR=0.0
Pod documented
798 1 my $self = shift;
799 1 $self->do_command("dragAndDrop", @_);
800 }
801  
802  
803 1 ▶sub drag_and_drop_to_object {
Subroutine drag_and_drop_to_object: called CC=1 SCAR=0.0
Pod documented
804 1 my $self = shift;
805 1 $self->do_command("dragAndDropToObject", @_);
806 }
807  
808  
809 1 ▶sub window_focus {
Subroutine window_focus: called CC=1 SCAR=0.0
Pod documented
810 1 my $self = shift;
811 1 $self->do_command("windowFocus", @_);
812 }
813  
814  
815 1 ▶sub window_maximize {
Subroutine window_maximize: called CC=1 SCAR=0.0
Pod documented
816 1 my $self = shift;
817 1 $self->do_command("windowMaximize", @_);
818 }
819  
820  
821 1 ▶sub get_all_window_ids {
Subroutine get_all_window_ids: called CC=1 SCAR=0.0
Pod documented
822 1 my $self = shift;
823 1 return $self->get_string_array("getAllWindowIds", @_);
824 }
825  
826  
827 1 ▶sub get_all_window_names {
Subroutine get_all_window_names: called CC=1 SCAR=0.0
Pod documented
828 1 my $self = shift;
829 1 return $self->get_string_array("getAllWindowNames", @_);
830 }
831  
832  
833 1 ▶sub get_all_window_titles {
Subroutine get_all_window_titles: called CC=1 SCAR=0.0
Pod documented
834 1 my $self = shift;
835 1 return $self->get_string_array("getAllWindowTitles", @_);
836 }
837  
838  
839 1 ▶sub get_html_source {
Subroutine get_html_source: called CC=1 SCAR=0.0
Pod documented
840 1 my $self = shift;
841 1 return $self->get_string("getHtmlSource", @_);
842 }
843  
844  
845 1 ▶sub set_cursor_position {
Subroutine set_cursor_position: called CC=1 SCAR=0.0
Pod documented
846 1 my $self = shift;
847 1 $self->do_command("setCursorPosition", @_);
848 }
849  
850  
851 1 ▶sub get_element_index {
Subroutine get_element_index: called CC=1 SCAR=0.0
Pod documented
852 1 my $self = shift;
853 1 return $self->get_number("getElementIndex", @_);
854 }
855  
856  
857 1 ▶sub is_ordered {
Subroutine is_ordered: called CC=1 SCAR=0.0
Pod documented
858 1 my $self = shift;
859 1 return $self->get_boolean("isOrdered", @_);
860 }
861  
862  
863 1 ▶sub get_element_position_left {
Subroutine get_element_position_left: called CC=1 SCAR=0.0
Pod documented
864 1 my $self = shift;
865 1 return $self->get_number("getElementPositionLeft", @_);
866 }
867  
868  
869 1 ▶sub get_element_position_top {
Subroutine get_element_position_top: called CC=1 SCAR=0.0
Pod documented
870 1 my $self = shift;
871 1 return $self->get_number("getElementPositionTop", @_);
872 }
873  
874  
875 1 ▶sub get_element_width {
Subroutine get_element_width: called CC=1 SCAR=0.0
Pod documented
876 1 my $self = shift;
877 1 return $self->get_number("getElementWidth", @_);
878 }
879  
880  
881 1 ▶sub get_element_height {
Subroutine get_element_height: called CC=1 SCAR=0.0
Pod documented
882 1 my $self = shift;
883 1 return $self->get_number("getElementHeight", @_);
884 }
885  
886  
887 1 ▶sub get_cursor_position {
Subroutine get_cursor_position: called CC=1 SCAR=0.0
Pod documented
888 1 my $self = shift;
889 1 return $self->get_number("getCursorPosition", @_);
890 }
891  
892  
893 1 ▶sub get_expression {
Subroutine get_expression: called CC=1 SCAR=0.0
Pod documented
894 1 my $self = shift;
895 1 return $self->get_string("getExpression", @_);
896 }
897  
898  
899 1 ▶sub get_xpath_count {
Subroutine get_xpath_count: called CC=1 SCAR=0.0
Pod documented
900 1 my $self = shift;
901 1 return $self->get_number("getXpathCount", @_);
902 }
903  
904  
905 1 ▶sub assign_id {
Subroutine assign_id: called CC=1 SCAR=0.0
Pod documented
906 1 my $self = shift;
907 1 $self->do_command("assignId", @_);
908 }
909  
910  
911 1 ▶sub allow_native_xpath {
Subroutine allow_native_xpath: called CC=1 SCAR=0.0
Pod documented
912 1 my $self = shift;
913 1 $self->do_command("allowNativeXpath", @_);
914 }
915  
916  
917 1 ▶sub ignore_attributes_without_value {
Subroutine ignore_attributes_without_value: called CC=1 SCAR=0.0
Pod documented
918 1 my $self = shift;
919 1 $self->do_command("ignoreAttributesWithoutValue", @_);
920 }
921  
922  
923 1 ▶sub wait_for_condition {
Subroutine wait_for_condition: called CC=1 SCAR=0.0
Pod documented
924 1 my $self = shift;
925 1 local $self->{_timeout} = $_[1];
926  
927 1 $self->do_command("waitForCondition", @_);
928 }
929  
930  
931 3 ▶sub set_timeout {
Subroutine set_timeout: called CC=1 SCAR=0.0
Pod documented
932 3 my $self = shift;
933 3 $self->{_timeout} = $_[0];
934  
935 3 $self->do_command("setTimeout", @_);
936 }
937  
938  
939 1 ▶sub wait_for_page_to_load {
Subroutine wait_for_page_to_load: called CC=1 SCAR=0.0
Pod documented
940 1 my $self = shift;
941 1 local $self->{_timeout} = $_[1];
942  
943 1 $self->do_command("waitForPageToLoad", @_);
944 }
945  
946  
947 1 ▶sub wait_for_frame_to_load {
Subroutine wait_for_frame_to_load: called CC=1 SCAR=0.0
Pod documented
948 1 my $self = shift;
949 1 local $self->{_timeout} = $_[1];
950  
951 1 $self->do_command("waitForFrameToLoad", @_);
952 }
953  
954  
955 1 ▶sub get_cookie {
Subroutine get_cookie: called CC=1 SCAR=0.0
Pod documented
956 1 my $self = shift;
957 1 return $self->get_string("getCookie", @_);
958 }
959  
960  
961 1 ▶sub get_cookie_by_name {
Subroutine get_cookie_by_name: called CC=1 SCAR=0.0
Pod documented
962 1 my $self = shift;
963 1 return $self->get_string("getCookieByName", @_);
964 }
965  
966  
967 1 ▶sub is_cookie_present {
Subroutine is_cookie_present: called CC=1 SCAR=0.0
Pod documented
968 1 my $self = shift;
969 1 return $self->get_boolean("isCookiePresent", @_);
970 }
971  
972  
973 1 ▶sub create_cookie {
Subroutine create_cookie: called CC=1 SCAR=0.0
Pod documented
974 1 my $self = shift;
975 1 $self->do_command("createCookie", @_);
976 }
977  
978  
979 1 ▶sub delete_cookie {
Subroutine delete_cookie: called CC=1 SCAR=0.0
Pod documented
980 1 my $self = shift;
981 1 $self->do_command("deleteCookie", @_);
982 }
983  
984  
985 1 ▶sub delete_all_visible_cookies {
Subroutine delete_all_visible_cookies: called CC=1 SCAR=0.0
Pod documented
986 1 my $self = shift;
987 1 $self->do_command("deleteAllVisibleCookies", @_);
988 }
989  
990  
991 1 ▶sub set_browser_log_level {
Subroutine set_browser_log_level: called CC=1 SCAR=0.0
Pod documented
992 1 my $self = shift;
993 1 $self->do_command("setBrowserLogLevel", @_);
994 }
995  
996  
997 1 ▶sub run_script {
Subroutine run_script: called CC=1 SCAR=0.0
Pod documented
998 1 my $self = shift;
999 1 $self->do_command("runScript", @_);
1000 }
1001  
1002  
1003 1 ▶sub add_location_strategy {
Subroutine add_location_strategy: called CC=1 SCAR=0.0
Pod documented
1004 1 my $self = shift;
1005 1 $self->do_command("addLocationStrategy", @_);
1006 }
1007  
1008  
1009 1 ▶sub capture_entire_page_screenshot {
Subroutine capture_entire_page_screenshot: called CC=1 SCAR=0.0
Pod documented
1010 1 my $self = shift;
1011 1 $self->do_command("captureEntirePageScreenshot", @_);
1012 }
1013  
1014  
1015 1 ▶sub rollup {
Subroutine rollup: called CC=1 SCAR=0.0
Pod documented
1016 1 my $self = shift;
1017 1 $self->do_command("rollup", @_);
1018 }
1019  
1020  
1021 1 ▶sub add_script {
Subroutine add_script: called CC=1 SCAR=0.0
Pod documented
1022 1 my $self = shift;
1023 1 $self->do_command("addScript", @_);
1024 }
1025  
1026  
1027 1 ▶sub remove_script {
Subroutine remove_script: called CC=1 SCAR=0.0
Pod documented
1028 1 my $self = shift;
1029 1 $self->do_command("removeScript", @_);
1030 }
1031  
1032  
1033 1 ▶sub use_xpath_library {
Subroutine use_xpath_library: called CC=1 SCAR=0.0
Pod documented
1034 1 my $self = shift;
1035 1 $self->do_command("useXpathLibrary", @_);
1036 }
1037  
1038  
1039 1 ▶sub set_context {
Subroutine set_context: called CC=1 SCAR=0.0
Pod documented
1040 1 my $self = shift;
1041 1 $self->do_command("setContext", @_);
1042 }
1043  
1044  
1045 1 ▶sub attach_file {
Subroutine attach_file: called CC=1 SCAR=0.0
Pod documented
1046 1 my $self = shift;
1047 1 $self->do_command("attachFile", @_);
1048 }
1049  
1050  
1051 1 ▶sub capture_screenshot {
Subroutine capture_screenshot: called CC=1 SCAR=0.0
Pod documented
1052 1 my $self = shift;
1053 1 $self->do_command("captureScreenshot", @_);
1054 }
1055  
1056  
1057 1 ▶sub capture_screenshot_to_string {
Subroutine capture_screenshot_to_string: called CC=1 SCAR=0.0
Pod documented
1058 1 my $self = shift;
1059 1 return $self->get_string("captureScreenshotToString", @_);
1060 }
1061  
1062  
1063 1 ▶sub capture_entire_page_screenshot_to_string {
Subroutine capture_entire_page_screenshot_to_string: called CC=1 SCAR=0.0
Pod documented
1064 1 my $self = shift;
1065 1 return $self->get_string("captureEntirePageScreenshotToString", @_);
1066 }
1067  
1068  
1069 1 ▶sub shut_down_selenium_server {
Subroutine shut_down_selenium_server: called CC=1 SCAR=0.0
Pod documented
1070 1 my $self = shift;
1071 1 $self->do_command("shutDownSeleniumServer", @_);
1072 }
1073  
1074  
1075 1 ▶sub retrieve_last_remote_control_logs {
Subroutine retrieve_last_remote_control_logs: called CC=1 SCAR=0.0
Pod documented
1076 1 my $self = shift;
1077 1 return $self->get_string("retrieveLastRemoteControlLogs", @_);
1078 }
1079  
1080  
1081 1 ▶sub key_down_native {
Subroutine key_down_native: called CC=1 SCAR=0.0
Pod documented
1082 1 my $self = shift;
1083 1 $self->do_command("keyDownNative", @_);
1084 }
1085  
1086  
1087 1 ▶sub key_up_native {
Subroutine key_up_native: called CC=1 SCAR=0.0
Pod documented
1088 1 my $self = shift;
1089 1 $self->do_command("keyUpNative", @_);
1090 }
1091  
1092  
1093 1 ▶sub key_press_native {
Subroutine key_press_native: called CC=1 SCAR=0.0
Pod documented
1094 1 my $self = shift;
1095 1 $self->do_command("keyPressNative", @_);
1096 }
1097  
1098  
1099 1 ▶sub wait_for_text_present {
Subroutine wait_for_text_present: called CC=1 SCAR=0.0
Pod documented
1100 1 my $self = shift;
1101 1 $self->do_command("waitForTextPresent", @_);
1102 }
1103  
1104  
1105 1 ▶sub wait_for_element_present {
Subroutine wait_for_element_present: called CC=1 SCAR=0.0
Pod documented
1106 1 my $self = shift;
1107 1 $self->do_command("waitForElementPresent", @_);
1108 }
1109  
1110  
1111  
1112 3 ▶sub is_location {
Subroutine is_location: called CC=2 SCAR=7.0
Pod documented
1113 3 my $self = shift;
1114 warn "is_location() is deprecated, use get_location()\n"
1115 3 ▶ unless $self->{no_deprecation_msg};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"no_deprecation_msg"} 0 3 3
1116 3 my $expected_location = shift;
1117 3 my $loc = $self->get_string("getLocation");
1118 3 return $loc =~ /\Q$expected_location\E$/;
1119 }
1120  
1121  
1122 4 ▶sub get_checked {
Subroutine get_checked: called CC=3 SCAR=11.1
Pod documented
1123 4 my $self = shift;
1124 warn "get_checked() is deprecated, use is_checked()\n"
1125 4 ▶ unless $self->{no_deprecation_msg};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"no_deprecation_msg"} 0 4 4
1126 4 ▶ return $self->get_string("isChecked", @_) ? 'true' : 'false';
Branch: 1 branch
BranchTrueFalseTotal
$self->get_string('isChecked', @_) ? : 2 1 3
1127 }
1128  
1129  
1130 9 ▶sub is_selected {
Subroutine is_selected: called CC=4 SCAR=13.9
Pod documented
1131 9 my ($self, $locator, $option_locator) = @_;
1132 warn "is_selected() is deprecated, use get_selected_*() methods\n"
1133 9 ▶ unless $self->{no_deprecation_msg};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"no_deprecation_msg"} 0 9 9
1134 9 $option_locator =~ m/^(?:(.+)=)?(.+)/;
1135 9 ▶ my $selector = $1 || 'label';
Condition100%2/2
$1 || 'label'
l!l
63
MC/DC100%1/1
$1 || 'label'
$1
Truth table100%2/2
A
A= $1
Aresult
11
00
1136 9 ▶ $selector = 'indexe' if $selector eq 'index';
Branch: 1 branch
BranchTrueFalseTotal
if $selector eq "index" 2 7 9
1137 9 my $pattern = $2;
1138 9 my $func = "get_selected_${selector}s";
1139 9 my @selected = $self->$func($locator);
1140 8 return grep { $pattern eq $_ } @selected;
1141 }
1142  
1143  
1144 4 ▶sub get_selected_options {
Subroutine get_selected_options: called CC=2 SCAR=7.1
Pod documented
1145 4 my $self = shift;
1146 warn "get_selected_options() is deprecated, use get_selected_labels()\n"
1147 4 ▶ unless $self->{no_deprecation_msg};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"no_deprecation_msg"} 0 4 4
1148 4 return $self->get_string_array("getSelectedLabels", @_);
1149 }
1150  
1151  
1152 2 ▶sub get_absolute_location {
Subroutine get_absolute_location: called CC=2 SCAR=7.1
Pod documented
1153 2 my $self = shift;
1154 warn "get_absolute_location() is deprecated, use get_location()\n"
1155 2 ▶ unless $self->{no_deprecation_msg};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"no_deprecation_msg"} 0 2 2
1156 2 return $self->get_string("getLocation", @_);
1157 }
1158  
1159  
1160 31 ▶sub DESTROY {
Subroutine DESTROY: called CC=2 SCAR=6.9
1161 31 my $self = shift;
1162 31 local $@;
1163 31 ▶ $self->stop if $self->{auto_stop};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"auto_stop"} 30 1 31
1164 }
1165  
1166 12 1;
1167  
1168 __END__
« lib/WWW/Selenium/Util.pm ↑ Summary blib/lib/Devel/REPL/Plugin/Selenium.pm »