Author: Erik Webb
To setup a simple site for testing these JMeter scripts, use the following Drush commands -
drush site-install --account-name="admin" --account-pass="admin" \
--site-name="Drupal JMeter Test" standard
drush user-create user --password="user"
-
drupal-jmeter-tricks.jmx: Sample JMeter test script with multiple thread groups to illustrate different techniques. The following scenarios are used as examples -
- Drupal Login: Login as a Drupal user, driven by a CSV file.
- Select From A List: View a content listing and select a single item at random to view.
- Traverse Menu Tree: Visit every page located in the main menu.
- Create a Node: Save a new piece of content using hard-coded values.
- Visit List of URLs: Visit every URL listed in a CSV file.
-
users.csv: Sample user dictionary file
-
urls.csv: Sample list of URLs to test against
There are a few configuration settings that require specific note here -
-
XPath query used to detect a Drupal error message -
//div[contains(concat(' ',normalize-space(@class),' '),' messages ') and contains(concat(' ',normalize-space(@class),' '),' error ')]
-
Choosing a random item from a JMeter list returned by the XPath Post Processor -
${__V(node_links_${__Random(1,${node_links_matchNr})})}
-
Check if a variable was successfully set -
"${node_links}".length > 0