line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Brownie::Node::SeleniumServer; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
6573
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
81
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
83
|
|
5
|
2
|
|
|
2
|
|
11
|
use parent 'Brownie::Node'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
18
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub attr { |
8
|
0
|
|
|
0
|
1
|
|
my ($self, $name) = @_; |
9
|
0
|
|
|
|
|
|
return $self->native->get_attribute($name); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub value { |
13
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
14
|
0
|
|
|
|
|
|
return $self->native->get_value; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub text { |
18
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
19
|
0
|
|
|
|
|
|
return $self->native->get_text; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub tag_name { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
return lc $self->native->get_tag_name; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub is_displayed { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
return $self->native->is_displayed; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub is_selected { |
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
return $self->native->is_selected; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub is_checked { |
38
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
39
|
0
|
|
|
|
|
|
return $self->native->is_selected; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub set { |
43
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
0
|
|
|
|
if ($self->tag_name eq 'input' and $self->type =~ /(?:checkbox|radio)/) { |
|
|
0
|
0
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$self->select; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ($self->tag_name eq 'input' or $self->tag_name eq 'textarea') { |
49
|
0
|
0
|
|
|
|
|
$self->native->clear if $self->type ne 'file'; |
50
|
0
|
|
|
|
|
|
$self->native->send_keys($value); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub select { |
55
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
56
|
0
|
0
|
|
|
|
|
$self->click unless $self->is_selected; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub unselect { |
60
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
61
|
|
|
|
|
|
|
# TODO: check if multiple select options |
62
|
0
|
0
|
|
|
|
|
$self->click if $self->is_selected; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub click { |
66
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
67
|
0
|
|
|
|
|
|
$self->native->click; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 NAME |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Brownie::Node::SeleniumServer |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 4 |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * C |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * C |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * C |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * C |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * C |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * C |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item * C |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * C |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * C |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * C |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * C |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * C |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * C |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * C |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * C |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item * C |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * C |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * C |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * C |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item * C |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * C |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item * C |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=back |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 AUTHOR |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
NAKAGAWA Masaki Emasaki@cpan.orgE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 LICENSE |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
133
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 SEE ALSO |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
L, L |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |