4

I'm working on what (should be) a simple Jmeter script whose goal is to load a pretty large amount of data into a software system for testing.

Jmeter records a ton of session-specific information that of course, can't really be "played back" in order for this to work. All the target application's url-construction is handled behind the scenes, and sent on the responses. Is there a way to simply "ignore" all this session data and more or less script JMeter as I would if I was running say, a QTP/Selenium test?

To try and clarify, we have buttons that post session-specific urls. I'd like to be able to just "click the buttons" and let things flow naturally without needing to handle any of the session specifics.

Sorry for the "click the button" metaphor, I know the tool doesn't interact with the GUI, but it's the best thing I can come up with.

avgvstvs
  • 6,196
  • 6
  • 43
  • 74

2 Answers2

1

Session data is not avoidable without back-end changes, such as disabling cookies/shutting off security tokens. Neither of which was an option here.

I handled the problem by capturing all the necessary session tokens and parameterizing my scripts properly.

avgvstvs
  • 6,196
  • 6
  • 43
  • 74
  • Can you add some details? Answering your own question is great, but why not help the next person? – fncomp Jun 06 '13 at 05:07
  • I'm not saying this to be rude, but "capturing session tokens" and "parameterizing the scripts" is as simple of a solution as it gets. Session data is implementation-specific and depends upon the underlying application container, and even the language. (j2ee=JESESSIONID) php does its own session-cookie magic. http://stackoverflow.com/questions/1389464/session-cookie-management-in-apache-jmeter That'll help you for OOB session cookies, but you'll have to handle CSRF tokens on a case-by-case basis using regex. – avgvstvs Jun 12 '13 at 12:41
  • For me, it was a CSRF token (well conceptually) in a hidden form element. I wound up using a CSS selector to read the value from the response. Thanks for replying. – fncomp Jun 13 '13 at 02:10
  • Did you use Jmeter to programatically manipulate the CSS selector? I'm not a front-end guy so I didn't really think about that approach. – avgvstvs Jun 20 '13 at 14:15
  • I just used a pretty general selector in the CSS/jQuery Extractor. In my case the token is stored in a conversation ID, so I did: `[name*="Cid"]`. – fncomp Jun 20 '13 at 21:09
0

JMeter doesn't parse HTML and execute Javascript for performance reasons (it takes a lot of time). Instead JMeter works at HTTP protocol level. Thus it uses a lot less system resources than Selenium tests.

You have to structure those HTTP requests yourself and you have to handle session specifics. Maybe, HTTP Proxy Server will make your life easier.

Andrei Botalov
  • 20,686
  • 11
  • 89
  • 123
  • Well, I had already figured out how to record steps and whatnot, but it took a little while to figure out that I had managed to miss a recording step. – avgvstvs Nov 15 '12 at 19:07