Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter: How to record a script for specific domain URLs?

Tags:

jmeter

I am trying to capture a script using HTTP(S) Test Script Recorder in JMeter3.0. When I start start capturing, URLs from other domains for ex. download.cdn.mozilla.net are also getting captured. I don't want these URLs to be recorded, I want to record URLs for a specific domain only. So, how to achieve this in JMeter3.0?

Note: I tried using URL Patters to Exclude but as I can not predict the other domain URLs, I don't want to use this option. I also tried URL Patters to Include by specifying a specific domain i.e. ^((?!DOMAINNAME).)*$, but it is still recording the other domain URLs.

like image 436
amitbobade Avatar asked Jan 05 '23 09:01

amitbobade


1 Answers

I would recommend breaking down your requirement into 2 parts:

  1. Include your domain only
  2. Exclude everything else

So, given I want to record JMeter Home Page and filter out any external resources the relevant configuration would be:

  • URL Patterns to Include: .*jmeter.apache.org.*
  • URL Pattens to Exclude: .*

HTTP(S) Test Script Recorder

Both inputs accept Perl5-compatible regular expressions so double check if the values your'e providing match (or don't match) the URL patterns captured by JMeter.

References:

  • JMeter Regular Expressions
  • Excluding Domains From The Load Test
like image 150
Dmitri T Avatar answered Feb 08 '23 14:02

Dmitri T