-1

Context: I am load testing a prototype enterprise web app that performs quick searches on a large dataset. It's backed by a database and uses JQuery datables backed by a servlet to narrow the results upon each keystroke.

I want to find out how it will behave under load and measure response time, stability and usability under various loads and come up with a SLA. The load in this case would be a number of users logging in, typing various search string, simultaneously.

Tools: I am using Apache Jmeter to do this.

Question: To truly make my load tests random and eliminate the effect of caching at database level (or anywhere else), I want my HTTP requests for each search to be random. I want to do something like this: send a character, wait, send another character, send backspace, send one more character, send two backspaces, etc.

What is the most elegant/efficient way of doing something like that using JMeter?

Right now I am looking into using CSV dataset and read random characters from a large file, but I'm wondering if there is a better way.

Ashkan Aryan
  • 3,504
  • 4
  • 30
  • 44

2 Answers2

1

I don't know your use case, but it seems unlikely that people are going to be typing in random characters. If I am correct, simulating random keystrokes could be just as misleading as using a very small set of search keywords.

Instead, you should locate or develop a set of keywords that people are likely to use - possibly be scanning the content they will be searching? Then use that to populate what users will enter when they are searching.

CMerrill
  • 1,857
  • 1
  • 14
  • 16
  • Yes that is correct, but I specifically wanted a random-set of character tuples to avoid caching kicking in - basically to cover worst case scenario. I also have a set of real words that are used in this case too, see http://stackoverflow.com/questions/7317943/jmeter-csv-dataset-config-how-to-move-through-variables-in-the-same-thread about my approach – Ashkan Aryan Sep 07 '11 at 10:02
1

You can achieve the random search strings by using functions.

Specifically, look at RANDOM and CHAR.

basically, you'd have something like ${__CHAR(${__RANDOM(0,82)})} to generate a single character.

I'd also recommend having a CSV file with the top 100 most popular search terms to test against.

BlackGaff
  • 7,579
  • 1
  • 38
  • 45
  • Yes I kind of ended up doing something like this, but using a function that calls a beanshell script which I have created to give either a random string or a random word from a large set... – Ashkan Aryan Sep 07 '11 at 10:03