build-ldap-test-plan.html
15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Apache JMeter - User's Manual: Building an LDAP Test Plan</title>
<style>
.code { font-weight: bold; }
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ftp-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="building"><strong>8a. Building an LDAP Test Plan</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>In this section, you will learn how to create a basic Test Plan to test an LDAP server.
You will create four users that send requests for four tests on the LDAP server. Also, you will tell
the users to run their tests 4 times. So, the total number of requests is (4 users) x (4 requests) x
repeat 4 times) = 40 LDAP requests. To construct the Test Plan, you will use the following elements:
<a href="test_plan.html#thread_group">Thread Group</a>,
<a href="../usermanual/component_reference.html#LDAP_Request">LDAP Request</a>,
<a href="../usermanual/component_reference.html#LDAP_Request_Defaults">LDAP Request Defaults</a>, and
<a href="../usermanual/component_reference.html#View_Results_in_Table">View Results in Table</a>
.</p><p>This example assumes that the LDAP Server is available at ldap.test.com.</p></blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="adding_users"><strong>8a.1 Adding Users</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>The first step you want to do with every JMeter Test Plan is to add a Thread Group element.
The Thread Group tells JMeter the number of users you want to simulate, how often the users should send
requests, and the how many requests they should send.</p><p>Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your
right mouse button to get the <span class="menuchoice">
<span class="guimenuitem">Add</span> </span>
menu, and then select
<span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">ThreadGroup</span> </span>
. You should now see the
Thread Group element under Test Plan. If you do not see the element, then "expand" the Test Plan tree by
clicking on the Test Plan element.
<table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/threadgroup.png"/><br>
<font size="-1">
Figure 8a.1. Thread Group and final test tree</font></td></tr></table>
</p></blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_login"><strong>8a.2 Adding Login Config Element</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>Begin by selecting the <tt class="code">LDAP Users</tt> element. Click your right mouse
button to get the Add menu, and then select
<span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">Config Element</span> → <span class="guimenuitem">Login Config Element</span> </span>
.
Then, select this new element to view its Control Panel.</p><p>Like most JMeter elements, the <tt class="code">Login Config Element</tt>'s Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/login-config-element.png"/><br>
<font size="-1">
Figure 8a.2 Login Config Element for our Test Plan</font></td></tr></table>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td><p>Enter Username field to "your LDAP Username",<br>
The password field to "your LDAP Password"</p>
<p>These values will be used by the LDAP Requests.</p></td></tr>
</table>
</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_defaults"><strong>8a.3 Adding LDAP Request Defaults</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>Begin by selecting the <tt class="code">LDAP Users</tt> element. Click your right mouse button
to get the <span class="menuchoice">
<span class="guimenuitem">Add</span> </span>
menu, and then select
<span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">Config Element</span> → <span class="guimenuitem">LDAP Request Defaults</span> </span>
. Then,
select this new element to view its Control Panel.</p><p>Like most JMeter elements, the <tt class="code">LDAP Request Defaults</tt> Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/requestdefaults.png"/><br>
<font size="-1">
Figure 8a.3 LDAP Defaults for our Test Plan</font></td></tr></table>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Enter <tt class="code">DN</tt> field to "<tt class="code">your LDAP Root Distinguished Name</tt>".<br>
Enter LDAP Server's <tt class="code">Servername</tt> field to "<tt class="code">ldap.test.com</tt>".<br>
The <tt class="code">port</tt> to <tt class="code">389</tt>.<br>
These values are default for the LDAP Requests.</td></tr>
</table>
</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_requests"><strong>8a.4 Adding LDAP Requests</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>In our Test Plan, we need to make four LDAP requests.</p><ol>
<li>Inbuilt Add Test</li>
<li>Inbuilt Search Test</li>
<li>Inbuilt Modify Test</li>
<li>Inbuilt Delete Test</li>
</ol><p>JMeter sends requests in the order that you add them to the tree.
Start by adding the first LDAP Request to the LDAP Users element
( <span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">Sampler</span> → <span class="guimenuitem">LDAP Request</span> </span>
). Then, select the LDAP Request element in the tree
and edit the following properties</p><ol>
<li>Rename to "<tt class="code">Add</tt>" this element</li>
<li>Select the <tt class="code">Add Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/add.png"/><br>
<font size="-1">
Figure 8a.4.1 LDAP Request for Inbuilt Add test</font></td></tr></table>
<p>You do not have to set the <tt class="code">Servername</tt> field, <tt class="code">port</tt> field, <tt class="code">Username</tt>, <tt class="code">Password</tt>
and <tt class="code">DN</tt> because you already specified this value in the <tt class="code">Login Config Element</tt> and
<tt class="code">LDAP Request Defaults.</tt></p><p>Next, add the second LDAP Request and edit the following
properties</p><ol>
<li>Rename to "<tt class="code">Search</tt>" this element</li>
<li>Select the <tt class="code">Search Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
</ol><p>
Next, add the Third LDAP Request and edit the following properties
</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/search.png"/><br>
<font size="-1">
Figure 8a.4.2 LDAP Request for Inbuilt Search test</font></td></tr></table>
<ol>
<li>Rename to "<tt class="code">Modify</tt>" this element</li>
<li>Select the <tt class="code">Modify Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
</ol><p>
Next, add the fourth LDAP Request and edit the following properties
</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/modify.png"/><br>
<font size="-1">
Figure 8a.4.3 LDAP Request for Inbuilt Modify test</font></td></tr></table>
<ol>
<li>Rename to "<tt class="code">Delete</tt>" this element</li>
<li>Select the <tt class="code">Delete Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/delete.png"/><br>
<font size="-1">
Figure 8a.4.4 LDAP Request for Inbuilt Delete test</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="ResponseAssertion"><strong>8a.5 Adding a Response Assertion</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>You can add a Response Assertion element.
This element will check the received response data by verifying if the response text is "<tt class="code">successful</tt>".
( <span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">Assertion</span> → <span class="guimenuitem">Response Assertion</span> </span>
).</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Note: A this position in the tree,
the Response Assertion will be executed for each LDAP Request.</td></tr>
</table>
</p>
<ol>
<li>Select <tt class="code">Text Response</tt> Radio button in <tt class="code">Response Field to Test</tt> group</li>
<li>Select <tt class="code">Substring</tt> Radio button in <tt class="code">Pattern Matching Rules</tt> group</li>
<li>Click on <tt class="code">Add</tt> button and add the string "<tt class="code">successful</tt>" in <tt class="code">Pattern to Test</tt> field</li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/responseassertion.png"/><br>
<font size="-1">
Figure 8a.5 LDAP Response Assertion</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_listener"><strong>8a.6 Adding a Listener to View/Store the Test Results</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>The final element you need to add to your Test Plan is a Listener.
This element is responsible for storing all of the results of your LDAP
requests in a file and presenting a visual model of the data. Select the LDAP
Users element and add a View Results in Table
( <span class="menuchoice">
<span class="guimenuitem">Add</span> → <span class="guimenuitem">Listener</span> → <span class="guimenuitem">View Results in Table</span> </span>
)</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img src="../../docs/images/screenshots/ldaptest/viewtable.png"/><br>
<font size="-1">
Figure 8a.6 View Results in Table Listener</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ftp-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright © 1999-2017, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id: build-ldap-test-plan.xml 1768727 2016-11-08 16:38:30Z fschumacher $
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->