| <!DOCTYPE html SYSTEM "about:legacy-compat"> |
| <html lang="en"> |
| <head> |
| <META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> |
| <title>Apache JMeter |
| - |
| User's Manual: Building an LDAP Test Plan</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <link href="https://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"> |
| <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" rel="stylesheet" type="text/css"> |
| <link rel="stylesheet" type="text/css" href="../css/new-style.css"> |
| <link rel="apple-touch-icon-precomposed" href="../images/apple-touch-icon.png"> |
| <link rel="icon" href="../images/favicon.png"> |
| <meta name="msapplication-TileColor" content="#ffffff"> |
| <meta name="msapplication-TileImage" content="../images/mstile-144x144.png"> |
| <meta name="theme-color" content="#ffffff"> |
| </head> |
| <body role="document"> |
| <a href="#content" class="hidden">Main content</a> |
| <div class="header"> |
| <!-- |
| APACHE LOGO |
| --> |
| <div> |
| <a href="https://www.apache.org"><img title="Apache Software Foundation" class="asf-logo logo" src="../images/asf-logo.svg" alt="Logo ASF"></a> |
| </div> |
| <!-- |
| PROJECT LOGO |
| --> |
| <div> |
| <a href="https://jmeter.apache.org/"><img class="logo" src="../images/logo.svg" alt="Apache JMeter"></a> |
| </div> |
| <div class="banner"> |
| <a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-234x60.png" alt="Current Apache event teaser"></a> |
| <div class="clear"></div> |
| </div> |
| </div> |
| <div class="nav"> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">About</div> |
| <ul> |
| <li> |
| <a href="../index.html">Overview</a> |
| </li> |
| <li> |
| <a href="https://www.apache.org/licenses/">License</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">Download</div> |
| <ul> |
| <li> |
| <a href="../download_jmeter.cgi">Download Releases</a> |
| </li> |
| <li> |
| <a href="../changes.html">Release Notes</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">Documentation</div> |
| <ul> |
| <li> |
| <a href="../usermanual/get-started.html">Get Started</a> |
| </li> |
| <li> |
| <a href="../usermanual/index.html">User Manual</a> |
| </li> |
| <li> |
| <a href="../usermanual/best-practices.html">Best Practices</a> |
| </li> |
| <li> |
| <a href="../usermanual/component_reference.html">Component Reference</a> |
| </li> |
| <li> |
| <a href="../usermanual/functions.html">Functions Reference</a> |
| </li> |
| <li> |
| <a href="../usermanual/properties_reference.html">Properties Reference</a> |
| </li> |
| <li> |
| <a href="../changes_history.html">Change History</a> |
| </li> |
| <li> |
| <a href="../api/index.html">Javadocs</a> |
| </li> |
| <li> |
| <a href="https://cwiki.apache.org/confluence/display/JMETER/Home">JMeter Wiki</a> |
| </li> |
| <li> |
| <a href="https://cwiki.apache.org/confluence/display/JMETER/JMeterFAQ">FAQ (Wiki)</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">Tutorials</div> |
| <ul> |
| <li> |
| <a href="../usermanual/jmeter_distributed_testing_step_by_step.html">Distributed Testing</a> |
| </li> |
| <li> |
| <a href="../usermanual/jmeter_proxy_step_by_step.html">Recording Tests</a> |
| </li> |
| <li> |
| <a href="../usermanual/junitsampler_tutorial.html">JUnit Sampler</a> |
| </li> |
| <li> |
| <a href="../usermanual/jmeter_accesslog_sampler_step_by_step.html">Access Log Sampler</a> |
| </li> |
| <li> |
| <a href="../usermanual/jmeter_tutorial.html">Extending JMeter</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">Community</div> |
| <ul> |
| <li> |
| <a href="../issues.html">Issue Tracking</a> |
| </li> |
| <li> |
| <a href="../security.html">Security</a> |
| </li> |
| <li> |
| <a href="../mail.html">Mailing Lists</a> |
| </li> |
| <li> |
| <a href="../svnindex.html">Source Repositories</a> |
| </li> |
| <li> |
| <a href="../building.html">Building and Contributing</a> |
| </li> |
| <li> |
| <a href="https://projects.apache.org/project.html?jmeter">Project info at Apache</a> |
| </li> |
| <li> |
| <a href="https://cwiki.apache.org/confluence/display/JMETER/JMeterCommitters">Contributors</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <ul class="menu"> |
| <li onClick="return true"> |
| <div class="menu-title">Foundation</div> |
| <ul> |
| <li> |
| <a href="https://www.apache.org/">The Apache Software Foundation (ASF)</a> |
| </li> |
| <li> |
| <a href="https://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a> |
| </li> |
| <li> |
| <a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> |
| </li> |
| <li> |
| <a href="https://www.apache.org/foundation/thanks.html">Thanks</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="main" id="content"> |
| <div class="social-media"> |
| <ul class="social-media-links"> |
| <li class="twitter"> |
| <a href="https://twitter.com/ApacheJMeter" title="Follow us on Twitter"><i class="fa fa-twitter" aria-hidden="true"></i>Twitter</a> |
| </li> |
| <li class="github"> |
| <a href="https://github.com/apache/jmeter" title="Fork us on github"><i class="fa fa-github" aria-hidden="true"></i>github</a> |
| </li> |
| </ul> |
| </div> |
| <ul class="pagelinks"> |
| <li> |
| <a href="build-ftp-test-plan.html">< Prev</a> |
| </li> |
| <li> |
| <a href="../index.html">Index</a> |
| </li> |
| <li> |
| <a href="build-ldapext-test-plan.html">Next ></a> |
| </li> |
| </ul> |
| <div class="section"> |
| <h1 id="building"> |
| 8a. Building an LDAP Test Plan<a class="sectionlink" href="#building" title="Link to here">¶</a> |
| </h1> |
| |
| <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) = 64 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> |
| |
| </div> |
| <div class="section"> |
| <h1 id="adding_users"> |
| 8a.1 Adding Users<a class="sectionlink" href="#adding_users" title="Link to here">¶</a> |
| </h1> |
| |
| <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. |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/threadgroup.png"><img src="../images/screenshots/ldaptest/threadgroup.png" width="" height="" alt=" |
| Figure 8a.1. Thread Group and final test tree"></a> |
| <figcaption> |
| Figure 8a.1. Thread Group and final test tree</figcaption> |
| </figure> |
| |
| </p> |
| |
| </div> |
| <div class="section"> |
| <h1 id="add_login"> |
| 8a.2 Adding Login Config Element<a class="sectionlink" href="#add_login" title="Link to here">¶</a> |
| </h1> |
| |
| <p> |
| Begin by selecting the <span class="code">LDAP Users</span> 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 <span class="code">Login Config Element</span>'s Control Panel has a name |
| field that you can modify. In this example, leave this field with the default value. |
| </p> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/login-config-element.png"><img src="../images/screenshots/ldaptest/login-config-element.png" width="" height="" alt=" |
| Figure 8a.2 Login Config Element for our Test Plan"></a> |
| <figcaption> |
| Figure 8a.2 Login Config Element for our Test Plan</figcaption> |
| </figure> |
| |
| <div class="clear"></div> |
| <div class="note"> |
| <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> |
| </div> |
| <div class="clear"></div> |
| |
| </div> |
| <div class="section"> |
| <h1 id="add_defaults"> |
| 8a.3 Adding LDAP Request Defaults<a class="sectionlink" href="#add_defaults" title="Link to here">¶</a> |
| </h1> |
| |
| <p> |
| Begin by selecting the <span class="code">LDAP Users</span> 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 <span class="code">LDAP Request Defaults</span> Control Panel has a name |
| field that you can modify. In this example, leave this field with the default value. |
| </p> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/requestdefaults.png"><img src="../images/screenshots/ldaptest/requestdefaults.png" width="" height="" alt=" |
| Figure 8a.3 LDAP Defaults for our Test Plan"></a> |
| <figcaption> |
| Figure 8a.3 LDAP Defaults for our Test Plan</figcaption> |
| </figure> |
| |
| <div class="clear"></div> |
| <div class="note"> |
| Enter <span class="code">DN</span> field to "<span class="code">your LDAP Root Distinguished Name</span>". |
| <br> |
| Enter LDAP Server's <span class="code">Servername</span> field to "<span class="code">ldap.test.com</span>". |
| <br> |
| The <span class="code">port</span> to <span class="code">389</span>. |
| <br> |
| These values are default for the LDAP Requests. |
| </div> |
| <div class="clear"></div> |
| |
| </div> |
| <div class="section"> |
| <h1 id="add_requests"> |
| 8a.4 Adding LDAP Requests<a class="sectionlink" href="#add_requests" title="Link to here">¶</a> |
| </h1> |
| |
| <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 "<span class="code">Add</span>" this element |
| </li> |
| |
| <li> |
| Select the <span class="code">Add Test</span> radio button in <span class="code">Test Configuration</span> group |
| </li> |
| |
| </ol> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/add.png"><img src="../images/screenshots/ldaptest/add.png" width="" height="" alt=" |
| Figure 8a.4.1 LDAP Request for Inbuilt Add test"></a> |
| <figcaption> |
| Figure 8a.4.1 LDAP Request for Inbuilt Add test</figcaption> |
| </figure> |
| |
| <p> |
| You do not have to set the <span class="code">Servername</span> field, <span class="code">port</span> field, <span class="code">Username</span>, <span class="code">Password</span> |
| and <span class="code">DN</span> because you already specified this value in the <span class="code">Login Config Element</span> and |
| <span class="code">LDAP Request Defaults.</span> |
| </p> |
| |
| <p>Next, add the second LDAP Request and edit the following |
| properties</p> |
| |
| <ol> |
| |
| <li> |
| Rename to "<span class="code">Search</span>" this element |
| </li> |
| |
| <li> |
| Select the <span class="code">Search Test</span> radio button in <span class="code">Test Configuration</span> group |
| </li> |
| |
| </ol> |
| |
| <p> |
| Next, add the Third LDAP Request and edit the following properties |
| </p> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/search.png"><img src="../images/screenshots/ldaptest/search.png" width="" height="" alt=" |
| Figure 8a.4.2 LDAP Request for Inbuilt Search test"></a> |
| <figcaption> |
| Figure 8a.4.2 LDAP Request for Inbuilt Search test</figcaption> |
| </figure> |
| |
| <ol> |
| |
| <li> |
| Rename to "<span class="code">Modify</span>" this element |
| </li> |
| |
| <li> |
| Select the <span class="code">Modify Test</span> radio button in <span class="code">Test Configuration</span> group |
| </li> |
| |
| </ol> |
| |
| <p> |
| Next, add the fourth LDAP Request and edit the following properties |
| </p> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/modify.png"><img src="../images/screenshots/ldaptest/modify.png" width="" height="" alt=" |
| Figure 8a.4.3 LDAP Request for Inbuilt Modify test"></a> |
| <figcaption> |
| Figure 8a.4.3 LDAP Request for Inbuilt Modify test</figcaption> |
| </figure> |
| |
| <ol> |
| |
| <li> |
| Rename to "<span class="code">Delete</span>" this element |
| </li> |
| |
| <li> |
| Select the <span class="code">Delete Test</span> radio button in <span class="code">Test Configuration</span> group |
| </li> |
| |
| </ol> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/delete.png"><img src="../images/screenshots/ldaptest/delete.png" width="" height="" alt=" |
| Figure 8a.4.4 LDAP Request for Inbuilt Delete test"></a> |
| <figcaption> |
| Figure 8a.4.4 LDAP Request for Inbuilt Delete test</figcaption> |
| </figure> |
| |
| </div> |
| <div class="section"> |
| <h1 id="ResponseAssertion"> |
| 8a.5 Adding a Response Assertion<a class="sectionlink" href="#ResponseAssertion" title="Link to here">¶</a> |
| </h1> |
| |
| <p> |
| You can add a Response Assertion element. |
| This element will check the received response data by verifying if the response text is "<span class="code">successful</span>". |
| (<span class="menuchoice"><span class="guimenuitem">Add</span> → <span class="guimenuitem">Assertion</span> → <span class="guimenuitem">Response Assertion</span></span>). |
| </p> |
| |
| <div class="clear"></div> |
| <div class="note">Note: A this position in the tree, |
| the Response Assertion will be executed for each LDAP Request.</div> |
| <div class="clear"></div> |
| |
| <ol> |
| |
| <li> |
| Select <span class="code">Text Response</span> Radio button in <span class="code">Response Field to Test</span> group |
| </li> |
| |
| <li> |
| Select <span class="code">Substring</span> Radio button in <span class="code">Pattern Matching Rules</span> group |
| </li> |
| |
| <li> |
| Click on <span class="code">Add</span> button and add the string "<span class="code">successful</span>" in <span class="code">Pattern to Test</span> field |
| </li> |
| |
| </ol> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/responseassertion.png"><img src="../images/screenshots/ldaptest/responseassertion.png" width="" height="" alt=" |
| Figure 8a.5 LDAP Response Assertion"></a> |
| <figcaption> |
| Figure 8a.5 LDAP Response Assertion</figcaption> |
| </figure> |
| |
| </div> |
| <div class="section"> |
| <h1 id="add_listener"> |
| 8a.6 Adding a Listener to View/Store the Test Results<a class="sectionlink" href="#add_listener" title="Link to here">¶</a> |
| </h1> |
| |
| <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> |
| |
| <figure> |
| <a href="../images/screenshots/ldaptest/viewtable.png"><img src="../images/screenshots/ldaptest/viewtable.png" width="" height="" alt=" |
| Figure 8a.6 View Results in Table Listener"></a> |
| <figcaption> |
| Figure 8a.6 View Results in Table Listener</figcaption> |
| </figure> |
| |
| </div> |
| <ul class="pagelinks"> |
| <li> |
| <a href="build-ftp-test-plan.html">< Prev</a> |
| </li> |
| <li> |
| <a href="../index.html">Index</a> |
| </li> |
| <li> |
| <a href="build-ldapext-test-plan.html">Next ></a> |
| </li> |
| </ul> |
| <div class="share-links"> |
| Share this page: |
| |
| <ul> |
| <li class="fb"> |
| <a data-social-url="https://facebook.com/sharer/sharer.php?u=" title="Share on facebook"><i class="fa fa-facebook" aria-hidden="true"></i>share</a> |
| </li> |
| <li class="twitter"> |
| <a data-social-url="https://twitter.com/intent/tweet?url=" title="Tweet on twitter"><i class="fa fa-twitter" aria-hidden="true"></i>tweet</a> |
| </li> |
| </ul> |
| </div> |
| <a href="#top" id="topButton">Go to top</a> |
| </div> |
| <div class="footer"> |
| <div class="copyright"> |
| Copyright © |
| 1999 – |
| 2022 |
| , Apache Software Foundation |
| </div> |
| <div class="trademarks">Apache, Apache JMeter, JMeter, the Apache |
| feather, and the Apache JMeter logo are |
| trademarks of the |
| Apache Software Foundation. |
| </div> |
| </div> |
| <script>(function(){ |
| "use strict"; |
| // enable 'go to top' button functionality |
| document.addEventListener('scroll', function() { |
| if (document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) { |
| document.getElementById("topButton").style.display = "block"; |
| } else { |
| document.getElementById("topButton").style.display = "none"; |
| } |
| }); |
| // fill in the current location into social links on this page. |
| var as = document.getElementsByTagName('a'); |
| var loc = document.location.href; |
| if (!loc.toLowerCase().startsWith('http')) { |
| return; |
| } |
| for (var i=0; i<as.length; i++) { |
| var href = as[i].getAttribute('data-social-url'); |
| if (href !== null) { |
| as[i].href = href + encodeURIComponent(loc); |
| } |
| } |
| })();</script> |
| </body> |
| </html> |