Code Monkey home page Code Monkey logo

drupal-jmeter-tricks's Introduction

Drupal JMeter Tricks

Author: Erik Webb

Requirements

Test Site Setup

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"

Contents

  • drupal-jmeter-tricks.jmx: Sample JMeter test script with multiple thread groups to illustrate different techniques. The following scenarios are used as examples -

    1. Drupal Login: Login as a Drupal user, driven by a CSV file.
    2. Select From A List: View a content listing and select a single item at random to view.
    3. Traverse Menu Tree: Visit every page located in the main menu.
    4. Create a Node: Save a new piece of content using hard-coded values.
    5. 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

Explanations

There are a few configuration settings that require specific note here -

  1. XPath query used to detect a Drupal error message -

     //div[contains(concat(' ',normalize-space(@class),' '),' messages ') and contains(concat(' ',normalize-space(@class),' '),' error ')]
    
  2. Choosing a random item from a JMeter list returned by the XPath Post Processor -

     ${__V(node_links_${__Random(1,${node_links_matchNr})})}
    
  3. Check if a variable was successfully set -

     "${node_links}".length > 0
    

drupal-jmeter-tricks's People

Contributors

erikwebb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.