Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm facing an untraceable problem in creating a 50 users load test on a JSF web application.

The approach that I'm following is this:

  1. Writing a test script in Eclipse using Selenium RC API.
  2. Exporting the test script as JAR and placing it in JMeter's /lib/junit folder.
  3. My Test plan in JMeter is:

    "Test Plan"

    • Thread Group

    • JUnit Request.

    • jp@gc - Perfmon Metrics Collector.
    • View Results Tree.
  4. I either start Perfmon Metrics Collector serverAgent on the QA local build server OR the Amazon EC2 medium instance of the application, and add the server's IP and port number (where serverAgent is running) in the Perfmon Metrics Collector listener in my JMeter client.

  5. Since the sampler I've used is a JUnit request, I've managed multiple users through Selenium code. Here's sample Selenium script. On the JMeter console, I provide the number of threads in the Thread group.

  6. Along with Perfmon metrics collector, I'm using the command:

      top | grep java
    

    on the server's terminal to check the load.

  7. I run Selenium server before I start the JMeter test case.

Now, the problems I'm facing are:

  • I can't run the test plan in JMeter for more than 4-6 users (thread) on one machine because for n users, the selenium server creates 2n instances of the browser. (in my case, Chrome) which actually kills the CPU if the users are more than 6! So, here what i've done is I've installed JMeter on 6 machines to create atleast a 30- 36 users load. But that too doesn't work well.
  • Perfmon metrics collector shows high load, whereas the top | grep java command run on the application server shows no load / little load. So i'm not able to understand if the test is actually causing load on the application or not.
  • If i have 10 users manually using the application to create a load, that shows a good amount of load on the Amazon EC2 small instance of the application. And the same is not happening with automated load tests.

I know and have read that Selenium should not be used for load testing because it is not designed for load testing. The only reason why I'm using Selenium scripts with JMeter is JMeter alone is not working with JSF application due to JSessionID and ViewState issues that come up when I run proxy-recorded test cases on JMeter.

So, is there any other way I can create a real load on the JSF application with some other tool / some other approach without bothering about JSessionID and ViewState?

Suggestions/corrections will be extremely helpful. If any more inputs related to my query are needed please point them out. I'm a newbie in automation and load testing, kindly bear with me if I didn't explain things properly.

share|improve this question
2  
I suggest you scrap Selenium scripts and record your test using JMeter Proxy. You can then alter the test plan as shown here. –  mbonaci Jun 20 '12 at 8:22
    
I've already tried that number of times. It didn't help at all. I still get viewstate and jsession id issues inspite of using the extractors; which is why i later turned to Selenium scripts with JMeter. –  Abhijeet Vaikar Jun 20 '12 at 8:29
    
I used jMeter with JSF with no problems. Have you verified that your regex expression returns correct values? See also here. Which errors exactly have you encountered? –  mbonaci Jun 20 '12 at 9:42
    
You can test what your Regex expression returns using ViewResultsTree Regex tester. Debug component could also be helpful to examine what happens in runtime. –  mbonaci Jun 20 '12 at 9:43
    
I agree with mbonaci. You're way better off spending your time solving the jmeter issues than trying to turn to selenium for load testing. Consider this: running 50 selenium tests at the same time doesn't come close to 50 simultaneous hits to your site since there are long delays between each action in selenium and many of them don't trigger any gets or posts from the browser. On the other hand, 50 jmeter tests at the same time should provide a ton of traffic. –  Sam Woods Jun 20 '12 at 17:59
show 8 more comments

1 Answer 1

up vote 2 down vote accepted

Finally I found the solution to the problem I was facing. I just had to figure out on which requests I had to place the viewState extractors. I was actually placing extractors to every request where viewState was there in the response and using the extractor's reference in the next request.

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.