Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Currently I'm checking some client and server software and I wish to expand the testing coverage for it. Specifically I want to increase the quality of the load and stress testing that is performed so that it better reflects user usage.

To this end I've been looking at JMeter, however I've encountered an issue. Unlike a web browser, the client does not have support for using a proxy. This presents the problem that JMeter can't monitor the communication between the two systems to build up the test data.

Possibly JMeter provides for this very scenario, however it's not been obvious in the documentation that there is any facility for this. Although I have some ideas on how to approach this I can't be the first to have encountered this issue, so I'm putting the question out there: how best would you solve this issue?

share|improve this question
    
Have you seen this: jakarta.apache.org/jmeter/usermanual/…? For load testing, JMeter usually takes the place of your client. In the past I've had to write the steps in the test manually. –  Berin Loritsch Apr 6 '11 at 16:37
    
Yes thanks, I've read that and then some. To clarify, I'm aware that JMeter acts as a client; however JMeter has the ability to record the data transferred between client and server during a session, and then create tests based on what the client sent (albeit with some manual work). I could create / add to this data manually, but if I can record the data then it'll save hours of work. But if I must... BTW, this is exactly how JMeter would act when using a web browser. –  Paul McCabe Apr 6 '11 at 19:17
    
Have you considered using Selenium to record/playback the interactions? If so, you can use BrowserMob browsermob.com/performance-testing to perform the load testing. Here's someone who actually used the combo: eviltester.com/index.php/2010/03/04/… –  Berin Loritsch Apr 6 '11 at 19:35
    
It's an idea. It's used elsewhere for testing interaction on a different interface, but it would suffer the same problems (arguably more) in that the limitation isn't in the tools themselves, but with the lack of proxy setting ability in the client. The crux of the problem is that the requests from the client terminate at the test tool (assuming it is the server rather than just a proxy). –  Paul McCabe Apr 6 '11 at 20:04
    
Ok, are you saying that there is a proxy server in between your JMeter instance and the server under test? Or are you saying you want JMeter to be the proxy? The reason that I suggested Selenium is that they have the Firefox plugin that extends the browser to generate the scripts for you. That's assuming you want the second behavior. In the first option, you are looking at something like this: testingminded.com/2010/04/…;. Maybe the choice of words is what's causing my confusion... –  Berin Loritsch Apr 6 '11 at 20:28
show 1 more comment

1 Answer

up vote 1 down vote accepted

I discovered two methods that answer my own question; one of which is generic, the other specific to Java applications.

As the client that I was working with is written in Java, it is possible to set proxy details on the command line:

-Dhttp.proxyHost=proxyhostURL
-Dhttp.proxyPort=proxyPortNumber
-Dhttp.proxyUser=someUserName
-Dhttp.proxyPassword=somePassword

The Java VM automatically added proxy information to all network traffic from the client, allowing communications to be sent through JMeter and the session to be recorded and replayed back later. (rather than the client communication terminating at JMeter itself as was the original problem)

The second method was to create a small application that intercepted the client network traffic and inject the proxy information into the requests before it reached JMeter.

Both of the above methods worked.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.