drnic-celerity 0.0.6.17
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +75 -0
- data/License.txt +621 -0
- data/Manifest.txt +229 -0
- data/README.rdoc +78 -0
- data/Rakefile +25 -0
- data/benchmark/bm_2000_spans.rb +48 -0
- data/benchmark/bm_digg.rb +26 -0
- data/benchmark/bm_google_images.rb +36 -0
- data/benchmark/bm_input_locator.rb +69 -0
- data/benchmark/bm_text_input.rb +19 -0
- data/benchmark/loader.rb +14 -0
- data/celerity.gemspec +40 -0
- data/lib/celerity.rb +77 -0
- data/lib/celerity/browser.rb +888 -0
- data/lib/celerity/clickable_element.rb +73 -0
- data/lib/celerity/collections.rb +156 -0
- data/lib/celerity/container.rb +779 -0
- data/lib/celerity/default_viewer.rb +14 -0
- data/lib/celerity/disabled_element.rb +40 -0
- data/lib/celerity/element.rb +314 -0
- data/lib/celerity/element_collection.rb +107 -0
- data/lib/celerity/element_locator.rb +177 -0
- data/lib/celerity/elements/button.rb +45 -0
- data/lib/celerity/elements/file_field.rb +29 -0
- data/lib/celerity/elements/form.rb +23 -0
- data/lib/celerity/elements/frame.rb +77 -0
- data/lib/celerity/elements/image.rb +76 -0
- data/lib/celerity/elements/label.rb +11 -0
- data/lib/celerity/elements/link.rb +30 -0
- data/lib/celerity/elements/meta.rb +7 -0
- data/lib/celerity/elements/non_control_elements.rb +106 -0
- data/lib/celerity/elements/option.rb +32 -0
- data/lib/celerity/elements/radio_check.rb +115 -0
- data/lib/celerity/elements/select_list.rb +142 -0
- data/lib/celerity/elements/table.rb +144 -0
- data/lib/celerity/elements/table_cell.rb +29 -0
- data/lib/celerity/elements/table_elements.rb +42 -0
- data/lib/celerity/elements/table_row.rb +48 -0
- data/lib/celerity/elements/text_field.rb +169 -0
- data/lib/celerity/exception.rb +83 -0
- data/lib/celerity/htmlunit.rb +65 -0
- data/lib/celerity/htmlunit/commons-codec-1.4.jar +0 -0
- data/lib/celerity/htmlunit/commons-collections-3.2.1.jar +0 -0
- data/lib/celerity/htmlunit/commons-httpclient-3.1.jar +0 -0
- data/lib/celerity/htmlunit/commons-io-1.4.jar +0 -0
- data/lib/celerity/htmlunit/commons-lang-2.4.jar +0 -0
- data/lib/celerity/htmlunit/commons-logging-1.1.1.jar +0 -0
- data/lib/celerity/htmlunit/cssparser-0.9.5.jar +0 -0
- data/lib/celerity/htmlunit/htmlunit-2.6-SNAPSHOT.jar +0 -0
- data/lib/celerity/htmlunit/htmlunit-core-js-2.6-SNAPSHOT.jar +0 -0
- data/lib/celerity/htmlunit/nekohtml-1.9.13-20090820.100833-15.jar +0 -0
- data/lib/celerity/htmlunit/sac-1.3.jar +0 -0
- data/lib/celerity/htmlunit/serializer-2.7.1.jar +0 -0
- data/lib/celerity/htmlunit/xalan-2.7.1.jar +0 -0
- data/lib/celerity/htmlunit/xercesImpl-2.9.1.jar +0 -0
- data/lib/celerity/htmlunit/xml-apis-1.3.04.jar +0 -0
- data/lib/celerity/identifier.rb +11 -0
- data/lib/celerity/ignoring_web_connection.rb +15 -0
- data/lib/celerity/input_element.rb +25 -0
- data/lib/celerity/listener.rb +141 -0
- data/lib/celerity/resources/no_viewer.png +0 -0
- data/lib/celerity/short_inspect.rb +20 -0
- data/lib/celerity/util.rb +91 -0
- data/lib/celerity/viewer_connection.rb +89 -0
- data/lib/celerity/watir_compatibility.rb +83 -0
- data/lib/celerity/xpath_support.rb +48 -0
- data/spec/browser_authentication_spec.rb +16 -0
- data/spec/browser_spec.rb +300 -0
- data/spec/clickable_element_spec.rb +39 -0
- data/spec/default_viewer_spec.rb +23 -0
- data/spec/element_spec.rb +51 -0
- data/spec/filefield_spec.rb +18 -0
- data/spec/htmlunit_spec.rb +56 -0
- data/spec/index_offset_spec.rb +24 -0
- data/spec/listener_spec.rb +142 -0
- data/spec/spec_helper.rb +8 -0
- data/tasks/benchmark.rake +4 -0
- data/tasks/deployment.rake +43 -0
- data/tasks/environment.rake +7 -0
- data/tasks/fix.rake +25 -0
- data/tasks/jar.rake +57 -0
- data/tasks/rdoc.rake +4 -0
- data/tasks/rspec.rake +43 -0
- data/tasks/simple_ci.rake +94 -0
- data/tasks/snapshot.rake +22 -0
- data/tasks/website.rake +17 -0
- data/tasks/yard.rake +9 -0
- data/website/benchmarks.html +237 -0
- data/website/css/color.css +153 -0
- data/website/css/hacks.css +3 -0
- data/website/css/layout.css +179 -0
- data/website/css/screen.css +5 -0
- data/website/css/textmate.css +226 -0
- data/website/css/typography.css +72 -0
- data/website/gfx/body_bg.gif +0 -0
- data/website/gfx/button_bg.jpg +0 -0
- data/website/gfx/header_bg.jpg +0 -0
- data/website/gfx/header_left.jpg +0 -0
- data/website/gfx/header_right.jpg +0 -0
- data/website/gfx/nav_bg.jpg +0 -0
- data/website/index.html +133 -0
- data/website/yard/Celerity.html +50 -0
- data/website/yard/Celerity/Area.html +212 -0
- data/website/yard/Celerity/Areas.html +103 -0
- data/website/yard/Celerity/Browser.html +5594 -0
- data/website/yard/Celerity/Button.html +312 -0
- data/website/yard/Celerity/Buttons.html +103 -0
- data/website/yard/Celerity/CheckBox.html +347 -0
- data/website/yard/Celerity/CheckBoxes.html +103 -0
- data/website/yard/Celerity/ClickableElement.html +448 -0
- data/website/yard/Celerity/Container.html +7676 -0
- data/website/yard/Celerity/Dd.html +198 -0
- data/website/yard/Celerity/Dds.html +103 -0
- data/website/yard/Celerity/DefaultViewer.html +101 -0
- data/website/yard/Celerity/DisabledElement.html +252 -0
- data/website/yard/Celerity/Div.html +198 -0
- data/website/yard/Celerity/Divs.html +103 -0
- data/website/yard/Celerity/Dl.html +198 -0
- data/website/yard/Celerity/Dls.html +103 -0
- data/website/yard/Celerity/Dt.html +198 -0
- data/website/yard/Celerity/Dts.html +103 -0
- data/website/yard/Celerity/Element.html +1703 -0
- data/website/yard/Celerity/ElementCollection.html +725 -0
- data/website/yard/Celerity/ElementLocator.html +589 -0
- data/website/yard/Celerity/Em.html +198 -0
- data/website/yard/Celerity/Ems.html +103 -0
- data/website/yard/Celerity/Exception.html +23 -0
- data/website/yard/Celerity/Exception/CelerityException.html +32 -0
- data/website/yard/Celerity/Exception/MissingWayOfFindingObjectException.html +32 -0
- data/website/yard/Celerity/Exception/NavigationException.html +33 -0
- data/website/yard/Celerity/Exception/NoValueFoundException.html +33 -0
- data/website/yard/Celerity/Exception/ObjectDisabledException.html +33 -0
- data/website/yard/Celerity/Exception/ObjectReadOnlyException.html +33 -0
- data/website/yard/Celerity/Exception/UnexpectedPageException.html +33 -0
- data/website/yard/Celerity/Exception/UnknownCellException.html +33 -0
- data/website/yard/Celerity/Exception/UnknownFormException.html +33 -0
- data/website/yard/Celerity/Exception/UnknownFrameException.html +33 -0
- data/website/yard/Celerity/Exception/UnknownObjectException.html +33 -0
- data/website/yard/Celerity/Exception/UnknownRowException.html +33 -0
- data/website/yard/Celerity/FileField.html +289 -0
- data/website/yard/Celerity/FileFields.html +103 -0
- data/website/yard/Celerity/Form.html +284 -0
- data/website/yard/Celerity/Forms.html +103 -0
- data/website/yard/Celerity/Frame.html +527 -0
- data/website/yard/Celerity/Frames.html +103 -0
- data/website/yard/Celerity/H1.html +198 -0
- data/website/yard/Celerity/H1s.html +103 -0
- data/website/yard/Celerity/H2.html +198 -0
- data/website/yard/Celerity/H2s.html +103 -0
- data/website/yard/Celerity/H3.html +198 -0
- data/website/yard/Celerity/H3s.html +103 -0
- data/website/yard/Celerity/H4.html +198 -0
- data/website/yard/Celerity/H4s.html +103 -0
- data/website/yard/Celerity/H5.html +198 -0
- data/website/yard/Celerity/H5s.html +103 -0
- data/website/yard/Celerity/H6.html +198 -0
- data/website/yard/Celerity/H6s.html +103 -0
- data/website/yard/Celerity/Hidden.html +285 -0
- data/website/yard/Celerity/Hiddens.html +103 -0
- data/website/yard/Celerity/Image.html +645 -0
- data/website/yard/Celerity/Images.html +103 -0
- data/website/yard/Celerity/InputElement.html +271 -0
- data/website/yard/Celerity/Label.html +210 -0
- data/website/yard/Celerity/Labels.html +103 -0
- data/website/yard/Celerity/Li.html +198 -0
- data/website/yard/Celerity/Link.html +295 -0
- data/website/yard/Celerity/Links.html +103 -0
- data/website/yard/Celerity/Lis.html +103 -0
- data/website/yard/Celerity/Listener.html +821 -0
- data/website/yard/Celerity/Map.html +198 -0
- data/website/yard/Celerity/Maps.html +103 -0
- data/website/yard/Celerity/Meta.html +196 -0
- data/website/yard/Celerity/Metas.html +103 -0
- data/website/yard/Celerity/MethodGenerator.html +195 -0
- data/website/yard/Celerity/NonControlElement.html +212 -0
- data/website/yard/Celerity/Ol.html +198 -0
- data/website/yard/Celerity/Ols.html +103 -0
- data/website/yard/Celerity/Option.html +348 -0
- data/website/yard/Celerity/Options.html +103 -0
- data/website/yard/Celerity/P.html +198 -0
- data/website/yard/Celerity/Pre.html +198 -0
- data/website/yard/Celerity/Pres.html +103 -0
- data/website/yard/Celerity/Ps.html +103 -0
- data/website/yard/Celerity/Radio.html +339 -0
- data/website/yard/Celerity/RadioCheckCommon.html +453 -0
- data/website/yard/Celerity/Radios.html +103 -0
- data/website/yard/Celerity/SelectList.html +1122 -0
- data/website/yard/Celerity/SelectLists.html +103 -0
- data/website/yard/Celerity/ShortInspect.html +108 -0
- data/website/yard/Celerity/Span.html +198 -0
- data/website/yard/Celerity/Spans.html +103 -0
- data/website/yard/Celerity/Strong.html +198 -0
- data/website/yard/Celerity/Strongs.html +103 -0
- data/website/yard/Celerity/Table.html +1287 -0
- data/website/yard/Celerity/TableBodies.html +103 -0
- data/website/yard/Celerity/TableBody.html +203 -0
- data/website/yard/Celerity/TableCell.html +279 -0
- data/website/yard/Celerity/TableCells.html +103 -0
- data/website/yard/Celerity/TableElement.html +437 -0
- data/website/yard/Celerity/TableFooter.html +203 -0
- data/website/yard/Celerity/TableFooters.html +103 -0
- data/website/yard/Celerity/TableHeader.html +203 -0
- data/website/yard/Celerity/TableHeaders.html +103 -0
- data/website/yard/Celerity/TableRow.html +478 -0
- data/website/yard/Celerity/TableRows.html +103 -0
- data/website/yard/Celerity/Tables.html +103 -0
- data/website/yard/Celerity/TextField.html +938 -0
- data/website/yard/Celerity/TextFields.html +103 -0
- data/website/yard/Celerity/Th.html +208 -0
- data/website/yard/Celerity/Ul.html +209 -0
- data/website/yard/Celerity/Uls.html +103 -0
- data/website/yard/Celerity/Util.html +264 -0
- data/website/yard/Celerity/VERSION.html +44 -0
- data/website/yard/HtmlUnit.html +23 -0
- data/website/yard/HtmlUnit/Html.html +23 -0
- data/website/yard/HtmlUnit/Util.html +23 -0
- data/website/yard/Java/ComGargoylesoftwareHtmlunitHtml/HtmlPage.html +90 -0
- data/website/yard/Java/JavaLang/Iterable.html +103 -0
- data/website/yard/Java/OrgW3cDom/NamedNodeMap.html +97 -0
- data/website/yard/README.txt.html +116 -0
- data/website/yard/String.html +103 -0
- data/website/yard/all-files.html +22 -0
- data/website/yard/all-methods.html +3276 -0
- data/website/yard/all-namespaces.html +258 -0
- data/website/yard/app.js +18 -0
- data/website/yard/index.html +19 -0
- data/website/yard/jquery.js +11 -0
- data/website/yard/style.css +68 -0
- data/website/yard/syntax_highlight.css +21 -0
- metadata +307 -0
@@ -0,0 +1,589 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
6
|
+
<link rel="stylesheet" href="../style.css" type="text/css" charset="utf-8" />
|
7
|
+
<link rel="stylesheet" href="../syntax_highlight.css" type="text/css" charset="utf-8" />
|
8
|
+
|
9
|
+
<script src="../jquery.js" type="text/javascript" charset="utf-8"></script>
|
10
|
+
<script src="../app.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<title>Class: Celerity::ElementLocator</title>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div id="content">
|
15
|
+
<div class="section class Celerity_ElementLocator">
|
16
|
+
<h1 class="title">Class: Celerity::ElementLocator</h1>
|
17
|
+
<div class="section mixins">
|
18
|
+
<h1>Included Modules</h1>
|
19
|
+
<p><a title="Celerity::Exception" href="Exception.html">Celerity::Exception</a></p>
|
20
|
+
</div><div class="section docstring">
|
21
|
+
<p>
|
22
|
+
Used internally to locate elements on the page.
|
23
|
+
</p>
|
24
|
+
|
25
|
+
</div><div class="section attributes">
|
26
|
+
<h1>Attributes</h1>
|
27
|
+
|
28
|
+
|
29
|
+
<div class="instance">
|
30
|
+
<h2>Instance Attributes</h2>
|
31
|
+
<table>
|
32
|
+
|
33
|
+
<tr>
|
34
|
+
<th class="name">idents</td>
|
35
|
+
<td class="readwrite">
|
36
|
+
[<span id='idents-instance_method'>R</span><span id='idents%3D-instance_method'>W</span>]
|
37
|
+
</td>
|
38
|
+
<td class="visibility">
|
39
|
+
public
|
40
|
+
</td>
|
41
|
+
<td class="docstring">
|
42
|
+
<p>
|
43
|
+
Sets the attribute <tt>idents</tt>.
|
44
|
+
</p>
|
45
|
+
|
46
|
+
|
47
|
+
</td>
|
48
|
+
</tr>
|
49
|
+
|
50
|
+
</table>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div><div class="section constants">
|
54
|
+
|
55
|
+
</div><div class="section constructor">
|
56
|
+
<h1>Constructor Summary</h1>
|
57
|
+
<div id="initialize-instance_method" class="section method">
|
58
|
+
<div class="details_title">
|
59
|
+
<div class='section methodsignature'>
|
60
|
+
<tt class='def'>
|
61
|
+
<span class='visibility'>public</span>
|
62
|
+
<span class='return_types'></span>
|
63
|
+
<span class='name'>initialize</span><span class='args'>(container, element_class)</span>
|
64
|
+
<span class='block'></span>
|
65
|
+
</tt>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
</div><div class="section source">
|
69
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
70
|
+
<div class="source_code">
|
71
|
+
<table>
|
72
|
+
<tr>
|
73
|
+
<td>
|
74
|
+
<pre class="lines">
|
75
|
+
|
76
|
+
|
77
|
+
12
|
78
|
+
13
|
79
|
+
14
|
80
|
+
15
|
81
|
+
16
|
82
|
+
17
|
83
|
+
18
|
84
|
+
19
|
85
|
+
20
|
86
|
+
21</pre>
|
87
|
+
</td>
|
88
|
+
<td>
|
89
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 12</span>
|
90
|
+
|
91
|
+
<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='container identifier id'>container</span><span class='comma token'>,</span> <span class='element_class identifier id'>element_class</span><span class='rparen token'>)</span>
|
92
|
+
<span class='container identifier id'>container</span><span class='dot token'>.</span><span class='assert_exists identifier id'>assert_exists</span>
|
93
|
+
|
94
|
+
<span class='@container ivar id'>@container</span> <span class='assign token'>=</span> <span class='container identifier id'>container</span>
|
95
|
+
<span class='@object ivar id'>@object</span> <span class='assign token'>=</span> <span class='container identifier id'>container</span><span class='dot token'>.</span><span class='object identifier id'>object</span>
|
96
|
+
<span class='@element_class ivar id'>@element_class</span> <span class='assign token'>=</span> <span class='element_class identifier id'>element_class</span>
|
97
|
+
<span class='@attributes ivar id'>@attributes</span> <span class='assign token'>=</span> <span class='@element_class ivar id'>@element_class</span><span class='colon2 op'>::</span><span class='ATTRIBUTES constant id'>ATTRIBUTES</span> <span class='comment val'># could check for 'strict' here?</span>
|
98
|
+
<span class='@idents ivar id'>@idents</span> <span class='assign token'>=</span> <span class='@element_class ivar id'>@element_class</span><span class='colon2 op'>::</span><span class='TAGS constant id'>TAGS</span>
|
99
|
+
<span class='@tags ivar id'>@tags</span> <span class='assign token'>=</span> <span class='@idents ivar id'>@idents</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='e identifier id'>e</span><span class='bitor op'>|</span> <span class='e identifier id'>e</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='dot token'>.</span><span class='downcase identifier id'>downcase</span> <span class='rbrace token'>}</span>
|
100
|
+
<span class='end end kw'>end</span>
|
101
|
+
</pre>
|
102
|
+
</td>
|
103
|
+
</tr>
|
104
|
+
</table>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div> <div class="section visibilitygroup public">
|
109
|
+
<h1>Public Visibility</h1>
|
110
|
+
<div class="section methodsummary instance public">
|
111
|
+
<h1>Public Instance Method Summary</h1>
|
112
|
+
<table class="summary">
|
113
|
+
|
114
|
+
<tr>
|
115
|
+
<th class="signature">
|
116
|
+
<span class='name'><a title="#element_by_idents" href="#element_by_idents-instance_method">#element_by_idents</a></span><span class='args'>(idents = @idents)</span>
|
117
|
+
<span class='block'></span>
|
118
|
+
|
119
|
+
</th>
|
120
|
+
<td class="docstring">
|
121
|
+
|
122
|
+
|
123
|
+
</td>
|
124
|
+
</tr>
|
125
|
+
|
126
|
+
<tr>
|
127
|
+
<th class="signature">
|
128
|
+
<span class='name'><a title="#elements_by_idents" href="#elements_by_idents-instance_method">#elements_by_idents</a></span><span class='args'>(idents = @idents)</span>
|
129
|
+
<span class='block'></span>
|
130
|
+
|
131
|
+
</th>
|
132
|
+
<td class="docstring">
|
133
|
+
|
134
|
+
|
135
|
+
</td>
|
136
|
+
</tr>
|
137
|
+
|
138
|
+
<tr>
|
139
|
+
<th class="signature">
|
140
|
+
<span class='name'><a title="#find_by_conditions" href="#find_by_conditions-instance_method">#find_by_conditions</a></span><span class='args'>(conditions)</span>
|
141
|
+
<span class='block'></span>
|
142
|
+
|
143
|
+
</th>
|
144
|
+
<td class="docstring">
|
145
|
+
|
146
|
+
|
147
|
+
</td>
|
148
|
+
</tr>
|
149
|
+
|
150
|
+
<tr>
|
151
|
+
<th class="signature">
|
152
|
+
<span class='name'><a title="#find_by_id" href="#find_by_id-instance_method">#find_by_id</a></span><span class='args'>(what)</span>
|
153
|
+
<span class='block'></span>
|
154
|
+
|
155
|
+
</th>
|
156
|
+
<td class="docstring">
|
157
|
+
|
158
|
+
|
159
|
+
</td>
|
160
|
+
</tr>
|
161
|
+
|
162
|
+
<tr>
|
163
|
+
<th class="signature">
|
164
|
+
<span class='name'><a title="#find_by_label" href="#find_by_label-instance_method">#find_by_label</a></span><span class='args'>(what)</span>
|
165
|
+
<span class='block'></span>
|
166
|
+
|
167
|
+
</th>
|
168
|
+
<td class="docstring">
|
169
|
+
|
170
|
+
|
171
|
+
</td>
|
172
|
+
</tr>
|
173
|
+
|
174
|
+
<tr>
|
175
|
+
<th class="signature">
|
176
|
+
<span class='name'><a title="#find_by_xpath" href="#find_by_xpath-instance_method">#find_by_xpath</a></span><span class='args'>(what)</span>
|
177
|
+
<span class='block'></span>
|
178
|
+
|
179
|
+
</th>
|
180
|
+
<td class="docstring">
|
181
|
+
|
182
|
+
|
183
|
+
</td>
|
184
|
+
</tr>
|
185
|
+
|
186
|
+
</table>
|
187
|
+
</div>
|
188
|
+
<div class="section methoddetails instance public">
|
189
|
+
<h1>Public Instance Method Details</h1>
|
190
|
+
|
191
|
+
<div class="method">
|
192
|
+
<div class="method_header">
|
193
|
+
<h3>element_by_idents</h3>
|
194
|
+
</div><div id="element_by_idents-instance_method" class="section method">
|
195
|
+
<div class="details_title">
|
196
|
+
<div class='section methodsignature'>
|
197
|
+
<tt class='def'>
|
198
|
+
<span class='visibility'>public</span>
|
199
|
+
<span class='return_types'></span>
|
200
|
+
<span class='name'>element_by_idents</span><span class='args'>(idents = @idents)</span>
|
201
|
+
<span class='block'></span>
|
202
|
+
</tt>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</div><div class="section source">
|
206
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
207
|
+
<div class="source_code">
|
208
|
+
<table>
|
209
|
+
<tr>
|
210
|
+
<td>
|
211
|
+
<pre class="lines">
|
212
|
+
|
213
|
+
|
214
|
+
113
|
215
|
+
114
|
216
|
+
115</pre>
|
217
|
+
</td>
|
218
|
+
<td>
|
219
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 113</span>
|
220
|
+
|
221
|
+
<span class='def def kw'>def</span> <span class='element_by_idents identifier id'>element_by_idents</span><span class='lparen token'>(</span><span class='idents identifier id'>idents</span> <span class='assign token'>=</span> <span class='@idents ivar id'>@idents</span><span class='rparen token'>)</span>
|
222
|
+
<span class='get_by_idents identifier id'>get_by_idents</span><span class='lparen token'>(</span><span class='symbol val'>:find</span><span class='comma token'>,</span> <span class='idents identifier id'>idents</span><span class='rparen token'>)</span>
|
223
|
+
<span class='end end kw'>end</span>
|
224
|
+
</pre>
|
225
|
+
</td>
|
226
|
+
</tr>
|
227
|
+
</table>
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method">
|
234
|
+
<div class="method_header">
|
235
|
+
<h3>elements_by_idents</h3>
|
236
|
+
</div><div id="elements_by_idents-instance_method" class="section method">
|
237
|
+
<div class="details_title">
|
238
|
+
<div class='section methodsignature'>
|
239
|
+
<tt class='def'>
|
240
|
+
<span class='visibility'>public</span>
|
241
|
+
<span class='return_types'></span>
|
242
|
+
<span class='name'>elements_by_idents</span><span class='args'>(idents = @idents)</span>
|
243
|
+
<span class='block'></span>
|
244
|
+
</tt>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
</div><div class="section source">
|
248
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
249
|
+
<div class="source_code">
|
250
|
+
<table>
|
251
|
+
<tr>
|
252
|
+
<td>
|
253
|
+
<pre class="lines">
|
254
|
+
|
255
|
+
|
256
|
+
109
|
257
|
+
110
|
258
|
+
111</pre>
|
259
|
+
</td>
|
260
|
+
<td>
|
261
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 109</span>
|
262
|
+
|
263
|
+
<span class='def def kw'>def</span> <span class='elements_by_idents identifier id'>elements_by_idents</span><span class='lparen token'>(</span><span class='idents identifier id'>idents</span> <span class='assign token'>=</span> <span class='@idents ivar id'>@idents</span><span class='rparen token'>)</span>
|
264
|
+
<span class='get_by_idents identifier id'>get_by_idents</span><span class='lparen token'>(</span><span class='symbol val'>:select</span><span class='comma token'>,</span> <span class='idents identifier id'>idents</span><span class='rparen token'>)</span>
|
265
|
+
<span class='end end kw'>end</span>
|
266
|
+
</pre>
|
267
|
+
</td>
|
268
|
+
</tr>
|
269
|
+
</table>
|
270
|
+
</div>
|
271
|
+
</div>
|
272
|
+
</div>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
<div class="method">
|
276
|
+
<div class="method_header">
|
277
|
+
<h3>find_by_conditions</h3>
|
278
|
+
</div><div id="find_by_conditions-instance_method" class="section method">
|
279
|
+
<div class="details_title">
|
280
|
+
<div class='section methodsignature'>
|
281
|
+
<tt class='def'>
|
282
|
+
<span class='visibility'>public</span>
|
283
|
+
<span class='return_types'></span>
|
284
|
+
<span class='name'>find_by_conditions</span><span class='args'>(conditions)</span>
|
285
|
+
<span class='block'></span>
|
286
|
+
</tt>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
</div><div class="section source">
|
290
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
291
|
+
<div class="source_code">
|
292
|
+
<table>
|
293
|
+
<tr>
|
294
|
+
<td>
|
295
|
+
<pre class="lines">
|
296
|
+
|
297
|
+
|
298
|
+
23
|
299
|
+
24
|
300
|
+
25
|
301
|
+
26
|
302
|
+
27
|
303
|
+
28
|
304
|
+
29
|
305
|
+
30
|
306
|
+
31
|
307
|
+
32
|
308
|
+
33
|
309
|
+
34
|
310
|
+
35
|
311
|
+
36
|
312
|
+
37
|
313
|
+
38
|
314
|
+
39
|
315
|
+
40
|
316
|
+
41
|
317
|
+
42
|
318
|
+
43
|
319
|
+
44
|
320
|
+
45
|
321
|
+
46
|
322
|
+
47
|
323
|
+
48
|
324
|
+
49
|
325
|
+
50
|
326
|
+
51
|
327
|
+
52
|
328
|
+
53
|
329
|
+
54
|
330
|
+
55
|
331
|
+
56
|
332
|
+
57
|
333
|
+
58
|
334
|
+
59
|
335
|
+
60
|
336
|
+
61
|
337
|
+
62
|
338
|
+
63
|
339
|
+
64
|
340
|
+
65
|
341
|
+
66
|
342
|
+
67
|
343
|
+
68
|
344
|
+
69
|
345
|
+
70
|
346
|
+
71
|
347
|
+
72
|
348
|
+
73
|
349
|
+
74
|
350
|
+
75
|
351
|
+
76
|
352
|
+
77
|
353
|
+
78</pre>
|
354
|
+
</td>
|
355
|
+
<td>
|
356
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 23</span>
|
357
|
+
|
358
|
+
<span class='def def kw'>def</span> <span class='find_by_conditions identifier id'>find_by_conditions</span><span class='lparen token'>(</span><span class='conditions identifier id'>conditions</span><span class='rparen token'>)</span> <span class='comment val'># TODO: refactor without performance hit</span>
|
359
|
+
<span class='return return kw'>return</span> <span class='nil nil kw'>nil</span> <span class='unless unless_mod kw'>unless</span> <span class='@object ivar id'>@object</span> <span class='comment val'># probably means we're on a TextPage (content-type is "text/plain")</span>
|
360
|
+
|
361
|
+
<span class='@condition_idents ivar id'>@condition_idents</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
|
362
|
+
<span class='attributes identifier id'>attributes</span> <span class='assign token'>=</span> <span class='Hash constant id'>Hash</span><span class='dot token'>.</span><span class='new identifier id'>new</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='h identifier id'>h</span><span class='comma token'>,</span> <span class='k identifier id'>k</span><span class='bitor op'>|</span> <span class='h identifier id'>h</span><span class='lbrack token'>[</span><span class='k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span>
|
363
|
+
<span class='index identifier id'>index</span> <span class='assign token'>=</span> <span class='integer val'>0</span> <span class='comment val'># by default, return the first matching element</span>
|
364
|
+
<span class='text identifier id'>text</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
|
365
|
+
|
366
|
+
<span class='conditions identifier id'>conditions</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='how identifier id'>how</span><span class='comma token'>,</span> <span class='what identifier id'>what</span><span class='bitor op'>|</span>
|
367
|
+
<span class='case case kw'>case</span> <span class='how identifier id'>how</span>
|
368
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:object</span>
|
369
|
+
<span class='unless unless kw'>unless</span> <span class='what identifier id'>what</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='HtmlUnit constant id'>HtmlUnit</span><span class='colon2 op'>::</span><span class='Html constant id'>Html</span><span class='colon2 op'>::</span><span class='HtmlElement constant id'>HtmlElement</span><span class='rparen token'>)</span> <span class='orop op'>||</span> <span class='what identifier id'>what</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
|
370
|
+
<span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='dstring node'>"expected an HtmlUnit::Html::HtmlElement subclass, got #{what.inspect}:#{what.class}"</span>
|
371
|
+
<span class='end end kw'>end</span>
|
372
|
+
<span class='return return kw'>return</span> <span class='what identifier id'>what</span>
|
373
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:xpath</span>
|
374
|
+
<span class='return return kw'>return</span> <span class='find_by_xpath identifier id'>find_by_xpath</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
375
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:label</span>
|
376
|
+
<span class='return return kw'>return</span> <span class='find_by_label identifier id'>find_by_label</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span> <span class='unless unless_mod kw'>unless</span> <span class='@attributes ivar id'>@attributes</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='symbol val'>:label</span><span class='rparen token'>)</span>
|
377
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:class_name</span>
|
378
|
+
<span class='how identifier id'>how</span> <span class='assign token'>=</span> <span class='symbol val'>:class</span>
|
379
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:url</span>
|
380
|
+
<span class='how identifier id'>how</span> <span class='assign token'>=</span> <span class='symbol val'>:href</span>
|
381
|
+
<span class='when when kw'>when</span> <span class='symbol val'>:caption</span>
|
382
|
+
<span class='how identifier id'>how</span> <span class='assign token'>=</span> <span class='symbol val'>:text</span>
|
383
|
+
<span class='end end kw'>end</span>
|
384
|
+
|
385
|
+
<span class='if if kw'>if</span> <span class='how identifier id'>how</span> <span class='eq op'>==</span> <span class='colon op'>:</span><span class='id identifier id'>id</span> <span class='andop op'>&&</span> <span class='conditions identifier id'>conditions</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
|
386
|
+
<span class='return return kw'>return</span> <span class='find_by_id identifier id'>find_by_id</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
387
|
+
<span class='elsif elsif kw'>elsif</span> <span class='@attributes ivar id'>@attributes</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='how identifier id'>how</span> <span class='assign token'>=</span> <span class='how identifier id'>how</span><span class='dot token'>.</span><span class='to_sym identifier id'>to_sym</span><span class='rparen token'>)</span>
|
388
|
+
<span class='attributes identifier id'>attributes</span><span class='lbrack token'>[</span><span class='how identifier id'>how</span><span class='rbrack token'>]</span> <span class='lshft op'><<</span> <span class='what identifier id'>what</span>
|
389
|
+
<span class='elsif elsif kw'>elsif</span> <span class='how identifier id'>how</span> <span class='eq op'>==</span> <span class='symbol val'>:index</span>
|
390
|
+
<span class='index identifier id'>index</span> <span class='assign token'>=</span> <span class='what identifier id'>what</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span> <span class='minus op'>-</span> <span class='Celerity.index_offset constant id'>Celerity.index_offset</span>
|
391
|
+
<span class='elsif elsif kw'>elsif</span> <span class='how identifier id'>how</span> <span class='eq op'>==</span> <span class='symbol val'>:text</span>
|
392
|
+
<span class='text identifier id'>text</span> <span class='assign token'>=</span> <span class='what identifier id'>what</span>
|
393
|
+
<span class='else else kw'>else</span>
|
394
|
+
<span class='raise identifier id'>raise</span> <span class='MissingWayOfFindingObjectException constant id'>MissingWayOfFindingObjectException</span><span class='comma token'>,</span> <span class='dstring node'>"No how #{how.inspect}"</span>
|
395
|
+
<span class='end end kw'>end</span>
|
396
|
+
<span class='end end kw'>end</span>
|
397
|
+
|
398
|
+
<span class='@idents ivar id'>@idents</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='ident identifier id'>ident</span><span class='bitor op'>|</span>
|
399
|
+
<span class='merged identifier id'>merged</span> <span class='assign token'>=</span> <span class='attributes identifier id'>attributes</span><span class='dot token'>.</span><span class='merge identifier id'>merge</span><span class='lparen token'>(</span><span class='ident identifier id'>ident</span><span class='dot token'>.</span><span class='attributes identifier id'>attributes</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='key identifier id'>key</span><span class='comma token'>,</span> <span class='v1 identifier id'>v1</span><span class='comma token'>,</span> <span class='v2 identifier id'>v2</span><span class='bitor op'>|</span> <span class='v1 identifier id'>v1</span> <span class='bitor op'>|</span> <span class='v2 identifier id'>v2</span> <span class='rbrace token'>}</span>
|
400
|
+
<span class='id identifier id'>id</span> <span class='assign token'>=</span> <span class='Identifier constant id'>Identifier</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='ident identifier id'>ident</span><span class='dot token'>.</span><span class='tag identifier id'>tag</span><span class='comma token'>,</span> <span class='merged identifier id'>merged</span><span class='rparen token'>)</span>
|
401
|
+
<span class='id identifier id'>id</span><span class='dot token'>.</span><span class='text identifier id'>text</span> <span class='assign token'>=</span> <span class='ident identifier id'>ident</span><span class='dot token'>.</span><span class='text identifier id'>text</span> <span class='orop op'>||</span> <span class='text identifier id'>text</span> <span class='comment val'># «original» identifier takes precedence for :text</span>
|
402
|
+
<span class='@condition_idents ivar id'>@condition_idents</span> <span class='lshft op'><<</span> <span class='id identifier id'>id</span>
|
403
|
+
<span class='end end kw'>end</span>
|
404
|
+
|
405
|
+
<span class='if if kw'>if</span> <span class='index identifier id'>index</span> <span class='eq op'>==</span> <span class='integer val'>0</span>
|
406
|
+
<span class='element_by_idents identifier id'>element_by_idents</span><span class='lparen token'>(</span><span class='@condition_idents ivar id'>@condition_idents</span><span class='rparen token'>)</span>
|
407
|
+
<span class='else else kw'>else</span>
|
408
|
+
<span class='elements_by_idents identifier id'>elements_by_idents</span><span class='lparen token'>(</span><span class='@condition_idents ivar id'>@condition_idents</span><span class='rparen token'>)</span><span class='lbrack token'>[</span><span class='index identifier id'>index</span><span class='rbrack token'>]</span>
|
409
|
+
<span class='end end kw'>end</span>
|
410
|
+
|
411
|
+
<span class='rescue rescue kw'>rescue</span> <span class='HtmlUnit constant id'>HtmlUnit</span><span class='colon2 op'>::</span><span class='ElementNotFoundException constant id'>ElementNotFoundException</span>
|
412
|
+
<span class='nil nil kw'>nil</span> <span class='comment val'># for rcov</span>
|
413
|
+
<span class='end end kw'>end</span>
|
414
|
+
</pre>
|
415
|
+
</td>
|
416
|
+
</tr>
|
417
|
+
</table>
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
</div>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div class="method">
|
424
|
+
<div class="method_header">
|
425
|
+
<h3>find_by_id</h3>
|
426
|
+
</div><div id="find_by_id-instance_method" class="section method">
|
427
|
+
<div class="details_title">
|
428
|
+
<div class='section methodsignature'>
|
429
|
+
<tt class='def'>
|
430
|
+
<span class='visibility'>public</span>
|
431
|
+
<span class='return_types'></span>
|
432
|
+
<span class='name'>find_by_id</span><span class='args'>(what)</span>
|
433
|
+
<span class='block'></span>
|
434
|
+
</tt>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
</div><div class="section source">
|
438
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
439
|
+
<div class="source_code">
|
440
|
+
<table>
|
441
|
+
<tr>
|
442
|
+
<td>
|
443
|
+
<pre class="lines">
|
444
|
+
|
445
|
+
|
446
|
+
80
|
447
|
+
81
|
448
|
+
82
|
449
|
+
83
|
450
|
+
84
|
451
|
+
85
|
452
|
+
86
|
453
|
+
87
|
454
|
+
88
|
455
|
+
89
|
456
|
+
90
|
457
|
+
91
|
458
|
+
92
|
459
|
+
93</pre>
|
460
|
+
</td>
|
461
|
+
<td>
|
462
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 80</span>
|
463
|
+
|
464
|
+
<span class='def def kw'>def</span> <span class='find_by_id identifier id'>find_by_id</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
465
|
+
<span class='case case kw'>case</span> <span class='what identifier id'>what</span>
|
466
|
+
<span class='when when kw'>when</span> <span class='Regexp constant id'>Regexp</span>
|
467
|
+
<span class='elements_by_tag_names identifier id'>elements_by_tag_names</span><span class='dot token'>.</span><span class='find identifier id'>find</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='elem identifier id'>elem</span><span class='bitor op'>|</span> <span class='elem identifier id'>elem</span><span class='dot token'>.</span><span class='getId identifier id'>getId</span> <span class='match op'>=~</span> <span class='what identifier id'>what</span> <span class='rbrace token'>}</span>
|
468
|
+
<span class='when when kw'>when</span> <span class='String constant id'>String</span>
|
469
|
+
<span class='obj identifier id'>obj</span> <span class='assign token'>=</span> <span class='@object ivar id'>@object</span><span class='dot token'>.</span><span class='getElementById identifier id'>getElementById</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
470
|
+
<span class='return return kw'>return</span> <span class='obj identifier id'>obj</span> <span class='if if_mod kw'>if</span> <span class='@tags ivar id'>@tags</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='obj identifier id'>obj</span><span class='dot token'>.</span><span class='getTagName identifier id'>getTagName</span><span class='rparen token'>)</span>
|
471
|
+
|
472
|
+
<span class='$stderr gvar id'>$stderr</span><span class='dot token'>.</span><span class='puts identifier id'>puts</span> <span class='dstring node'>"warning: multiple elements with identical id? (#{what.inspect})"</span> <span class='if if_mod kw'>if</span> <span class='$VERBOSE gvar id'>$VERBOSE</span>
|
473
|
+
<span class='elements_by_tag_names identifier id'>elements_by_tag_names</span><span class='dot token'>.</span><span class='find identifier id'>find</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='elem identifier id'>elem</span><span class='bitor op'>|</span> <span class='elem identifier id'>elem</span><span class='dot token'>.</span><span class='getId identifier id'>getId</span> <span class='eq op'>==</span> <span class='what identifier id'>what</span> <span class='rbrace token'>}</span>
|
474
|
+
<span class='else else kw'>else</span>
|
475
|
+
<span class='raise identifier id'>raise</span> <span class='TypeError constant id'>TypeError</span><span class='comma token'>,</span> <span class='dstring node'>"expected String or Regexp, got #{what.inspect}:#{what.class}"</span>
|
476
|
+
<span class='end end kw'>end</span>
|
477
|
+
<span class='end end kw'>end</span>
|
478
|
+
</pre>
|
479
|
+
</td>
|
480
|
+
</tr>
|
481
|
+
</table>
|
482
|
+
</div>
|
483
|
+
</div>
|
484
|
+
</div>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
<div class="method">
|
488
|
+
<div class="method_header">
|
489
|
+
<h3>find_by_label</h3>
|
490
|
+
</div><div id="find_by_label-instance_method" class="section method">
|
491
|
+
<div class="details_title">
|
492
|
+
<div class='section methodsignature'>
|
493
|
+
<tt class='def'>
|
494
|
+
<span class='visibility'>public</span>
|
495
|
+
<span class='return_types'></span>
|
496
|
+
<span class='name'>find_by_label</span><span class='args'>(what)</span>
|
497
|
+
<span class='block'></span>
|
498
|
+
</tt>
|
499
|
+
</div>
|
500
|
+
|
501
|
+
</div><div class="section source">
|
502
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
503
|
+
<div class="source_code">
|
504
|
+
<table>
|
505
|
+
<tr>
|
506
|
+
<td>
|
507
|
+
<pre class="lines">
|
508
|
+
|
509
|
+
|
510
|
+
100
|
511
|
+
101
|
512
|
+
102
|
513
|
+
103
|
514
|
+
104
|
515
|
+
105
|
516
|
+
106
|
517
|
+
107</pre>
|
518
|
+
</td>
|
519
|
+
<td>
|
520
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 100</span>
|
521
|
+
|
522
|
+
<span class='def def kw'>def</span> <span class='find_by_label identifier id'>find_by_label</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
523
|
+
<span class='obj identifier id'>obj</span> <span class='assign token'>=</span> <span class='elements_by_tag_names identifier id'>elements_by_tag_names</span><span class='lparen token'>(</span><span class='dstring node'>%w[label]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='find identifier id'>find</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='e identifier id'>e</span><span class='bitor op'>|</span> <span class='matches? fid id'>matches?</span><span class='lparen token'>(</span><span class='e identifier id'>e</span><span class='dot token'>.</span><span class='asText identifier id'>asText</span><span class='comma token'>,</span> <span class='what identifier id'>what</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
|
524
|
+
|
525
|
+
<span class='return return kw'>return</span> <span class='nil nil kw'>nil</span> <span class='unless unless_mod kw'>unless</span> <span class='obj identifier id'>obj</span> <span class='andop op'>&&</span> <span class='lparen token'>(</span><span class='ref identifier id'>ref</span> <span class='assign token'>=</span> <span class='obj identifier id'>obj</span><span class='dot token'>.</span><span class='getReferencedElement identifier id'>getReferencedElement</span><span class='rparen token'>)</span>
|
526
|
+
<span class='return return kw'>return</span> <span class='ref identifier id'>ref</span> <span class='if if_mod kw'>if</span> <span class='@tags ivar id'>@tags</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='ref identifier id'>ref</span><span class='dot token'>.</span><span class='getTagName identifier id'>getTagName</span><span class='rparen token'>)</span>
|
527
|
+
|
528
|
+
<span class='find_by_id identifier id'>find_by_id</span> <span class='obj identifier id'>obj</span><span class='dot token'>.</span><span class='getForAttribute identifier id'>getForAttribute</span>
|
529
|
+
<span class='end end kw'>end</span>
|
530
|
+
</pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
534
|
+
</div>
|
535
|
+
</div>
|
536
|
+
</div>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
<div class="method">
|
540
|
+
<div class="method_header">
|
541
|
+
<h3>find_by_xpath</h3>
|
542
|
+
</div><div id="find_by_xpath-instance_method" class="section method">
|
543
|
+
<div class="details_title">
|
544
|
+
<div class='section methodsignature'>
|
545
|
+
<tt class='def'>
|
546
|
+
<span class='visibility'>public</span>
|
547
|
+
<span class='return_types'></span>
|
548
|
+
<span class='name'>find_by_xpath</span><span class='args'>(what)</span>
|
549
|
+
<span class='block'></span>
|
550
|
+
</tt>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
</div><div class="section source">
|
554
|
+
<span>[<a class="source_link" href="#">View source</a>]</span>
|
555
|
+
<div class="source_code">
|
556
|
+
<table>
|
557
|
+
<tr>
|
558
|
+
<td>
|
559
|
+
<pre class="lines">
|
560
|
+
|
561
|
+
|
562
|
+
95
|
563
|
+
96
|
564
|
+
97
|
565
|
+
98</pre>
|
566
|
+
</td>
|
567
|
+
<td>
|
568
|
+
<pre class="code"><span class="info file"># File 'lib/celerity/element_locator.rb', line 95</span>
|
569
|
+
|
570
|
+
<span class='def def kw'>def</span> <span class='find_by_xpath identifier id'>find_by_xpath</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span>
|
571
|
+
<span class='what identifier id'>what</span> <span class='assign token'>=</span> <span class='dstring node'>".#{what}"</span> <span class='if if_mod kw'>if</span> <span class='what identifier id'>what</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='chr identifier id'>chr</span> <span class='eq op'>==</span> <span class='string val'>"/"</span>
|
572
|
+
<span class='@object ivar id'>@object</span><span class='dot token'>.</span><span class='getByXPath identifier id'>getByXPath</span><span class='lparen token'>(</span><span class='what identifier id'>what</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_a identifier id'>to_a</span><span class='dot token'>.</span><span class='first identifier id'>first</span>
|
573
|
+
<span class='end end kw'>end</span>
|
574
|
+
</pre>
|
575
|
+
</td>
|
576
|
+
</tr>
|
577
|
+
</table>
|
578
|
+
</div>
|
579
|
+
</div>
|
580
|
+
</div>
|
581
|
+
</div>
|
582
|
+
|
583
|
+
</div>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
</div>
|
587
|
+
</div>
|
588
|
+
</body>
|
589
|
+
</html>
|