Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:11:55+00:00 2026-06-15T13:11:55+00:00

I’d like to setup a JMeter test plan to suggest whether a web site

  • 0

I’d like to setup a JMeter test plan to suggest whether a web site (URL) is Drupal-based (based completely on the HTTP response from the site) and compare it with existing data that I have on the environment. (I realize that using an HTTP approach, as opposed to say examining the site’s file system, is “iffy” but I’m curious how useful the approach is)

The JMeter command line might look like this:

JMeter -t "DrupalAssertions.jmx" -Jurl=http://my.dot.com -Jdrupal=true

where I provide the URL to test and an additional property “drupal” indicating my best guess on whether the site is Drupal-based.

In my test plan, I add an HTTP Request to return the HTML content of the page for the URL. I’m then able to successfully add a Response Assertion that tests a pattern (say (?i)(drupal) for a sadly lacking pattern) to see if it’s contained in the response.

That much works fine, or as expected, but what I’d like to do is to compare the value of the “drupal” property against the result of that pattern test in that same Response Assertion. I know I’m missing something simple here, but I’m not seeing how to do that.

I want to try to use an expression like this:

(?i)(drupal) == ${__P(drupal)} 

in a pattern, but that doesn’t work. The name of the Compare Assertion looks promising, but I don’t see how to incorporate the property into a comparison.

Update: The approach suggested by PMD UBIK-INGENIERIE does work. I used a Regular Expression Extractor like this:

<RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Drupal in Response" enabled="true">
  <stringProp name="RegexExtractor.useHeaders">false</stringProp>
  <stringProp name="RegexExtractor.refname">drupalInResponse</stringProp>
  <stringProp name="RegexExtractor.regex">(.*drupal.*)</stringProp>
  <stringProp name="RegexExtractor.template">$0$</stringProp>
  <stringProp name="RegexExtractor.default">__false__</stringProp>
  <stringProp name="RegexExtractor.match_number">1</stringProp>
</RegexExtractor>

followed by this BeanShell Assertion:

// Variable "drupalInResponse" is "__false__" by default
if ( !(vars.get("drupalInResponse").equals("__false__") ) ) {
  vars.put("drupalInResponse","true");
}
else {
  vars.put("drupalInResponse","false");
}

print("\n\nThe value of property 'drupal' is: " + props.get("drupal") + "\n");
print("\n\nThe value of variable 'drupalInResponse' is: " + vars.get("drupalInResponse") + "\n");

if (vars.get("drupalInResponse").equals( props.get("drupal") ) ) { 
  print("Site Drupalness is consistent with your beliefs"); 
} 
else { 
  print("You're wrong about the site's Drupalness"); 
  Failure = true; 
  FailureMessage = "Incorrect Drupal assumption"; 
}

In the Regular Expression Extractor, I’d set a default value that I felt wouldn’t be matched by my pattern of interest, then did an ugly verbose Java comparison with the “drupal” property in the BeanShell Assertion.

Wish somehow that the assertion could be made in a single component rather than it having two parts, but you can’t argue with “working” 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:11:56+00:00Added an answer on June 15, 2026 at 1:11 pm

    You can use a regexp extractir with your first pattern

    Then use a Beanshell assertion which will use your variable and compare it to drupal property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.