participate


JavaServer Faces - JSF Testing with JMeter
<<   Back to Forum  |   Give us Feedback
This topic has 19 replies on 2 pages.    1 | 2 | Next »
bgOnline
Posts:92
Registered: 7/6/05
JSF Testing with JMeter   
Sep 19, 2005 2:29 AM

 
Hello,

Could someone help me to configure a test plan in JMeter in order to test a JSF application ? Actually, which parameters do I have to put in the request in order to execute a particular method of a JSF bean ? Indeed, it is no sufficient to call the page.jsf. How should I do ?

Thanks in advance.
bgOnline
 
Alexander_Jesse
Posts:154
Registered: 6/13/05
Re: JSF Testing with JMeter   
Sep 19, 2005 4:12 AM (reply 1 of 19)  (In reply to original post )

 
With JMeter you should not plan to test a single method.

JMeter is supposed to be used for functional testing or Loap&Performance testing. For that you only "simulate a normal user" and then repeat that simulation... The easiest way to do that is to use JMeter's transparent recording proxy (see JMeter doc). It is really easy to use and sets up single entries in the test-plan with all needed parameters.

testing a single method... sounds like unit-testing and therefor something in the JUnit-range. A managed bean that is completely free of container-calls (as it should be...) can be unit-tested as any other java-class. If you use container dependant calls (like access to the request-object or calls to EJB's,...) then the going gets tougher. as I have not yet entered that territory.... let's see if somebody else has some suggestions in that area...

hth
Alexander
 
bgOnline
Posts:92
Registered: 7/6/05
Re: JSF Testing with JMeter   
Sep 19, 2005 11:01 PM (reply 2 of 19)  (In reply to #1 )

 
I understand what you are saying, and I don't wanna test only one method.
On the contrary, I'd like to make a load test performance.
So, I have to enter an URL and to set up entries.
But I don't know how to set up entries so that it is the good action that is executed...
Do you understand what I mean ?

Could you give me some more info about the JMeter's transparent recording proxy, or just the tutorial URL ?
What is the goal of this tool ? Can I make a load test performance with it ?

If I make a unit test, I can't see what will happen if 100 users execute this method at a given time.

Thanks for your help !!
bgOnline
 
Alexander_Jesse
Posts:154
Registered: 6/13/05
Re: JSF Testing with JMeter   
Sep 20, 2005 1:26 AM (reply 3 of 19)  (In reply to #2 )

 
JMeter's proxy doc...
Let's go to the JMeter website (http://jakarta.apache.org/jmeter) then ... well, how about the user's guide (http://jakarta.apache.org/jmeter/usermanual/index.html) ... hm.... scroll down (or use find?) to find " 16.4 Using the Proxy Server to record test scripts" and follow the link (http://jakarta.apache.org/jmeter/usermanual/best-practices.html#proxy_server) there you find some introduction and a link (http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Proxy_Server) to some more doc about it.

When I first used it, the doc was not yet so detailed. IT IS easy, just try...
Good for dealing with JSF is the fact, that it will set up your request with all the POST-parameters.

hth
Alexander
 
orden
Posts:1
Registered: 10/11/06
Re: JSF Testing with JMeter   
Oct 11, 2006 3:44 PM (reply 4 of 19)  (In reply to #3 )

 
I manage to test JSF 1.2 using JMeter but there is a trick, even if you are using the HTTP Proxy:
1) The first HTTP request get a page with a form.
2) The second request perform a JSF action on this form.

Make sure that you are sending the value of javax.faces.ViewState found in the from at the second request, otherwise the View restore may fail.

For this, create a XPath extractor. The XPath query is: //input/@value. Choose a reference name, ViewState per example.

In the second http request, send a javax.faces.ViewState parameter with the value ${ViewState}.

I spent a couple of ours finding this. I am not a JSF1.2 seasoned programmer but I hope it will help saving you time.
 
DeepakVa
Posts:1
Registered: 11/27/06
Re: JSF Testing with JMeter   
Nov 27, 2006 2:27 AM (reply 5 of 19)  (In reply to #4 )

 
Hi,

Iam doing performance testing of an application written using JSF/ADF Framework. My first page is to log into the application.

But iam unable to login using JMETER. Please suggest what needs to be done. My request is as below.


http://localhost:port/context-root/index.jsp;jsessionid=xxxxx

parameters that are passed from JMeter are

loginForm:userName = username
loginForm:password=password
loginForm:_id44 = login
com.sun.faces.VIEW = _id57:_id58
loginForm=loginForm

Regards
Deepak
 
Timony
Posts:7
Registered: 9/23/05
Re: JSF Testing with JMeter   
Feb 1, 2007 12:28 AM (reply 6 of 19)  (In reply to #5 )

 
Hi,
Im also new in JMeter, but as I red the tutorial, there is mentioned, that some extra steps for URL rewrittening with SESSION_ID have to be done... As I remember, the sublink in the jmeter user guide was "Create Advanced web test" or something...

timony
 
pauster007
Posts:87
Registered: 7/12/03
Re: JSF Testing with JMeter   
Mar 8, 2007 9:59 AM (reply 7 of 19)  (In reply to #4 )

 
I manage to test JSF 1.2 using JMeter but there is a
trick, even if you are using the HTTP Proxy:
1) The first HTTP request get a page with a form.
2) The second request perform a JSF action on this
form.

Make sure that you are sending the value of
javax.faces.ViewState found in the from at the
second request, otherwise the View restore may fail.

For this, create a XPath extractor. The XPath query
is:
//input/@value.
Choose a reference name, ViewState per
example.

In the second http request, send a
javax.faces.ViewState parameter with the value
${ViewState}.

I spent a couple of ours finding this. I am not a
JSF1.2 seasoned programmer but I hope it will help
saving you time.

Has anyone succesfully implemented this? Where will I put the XPath extractor? As a child of the 1st Http Request? Im not getting any value for ${ViewState}

Message was edited by:
pauster007
 
pauster007
Posts:87
Registered: 7/12/03
Re: JSF Testing with JMeter   
Mar 23, 2007 5:56 AM (reply 8 of 19)  (In reply to #7 )

 
got it to work, thanks anyway :)
 
GN_olivier
Posts:1
Registered: 3/26/07
Re: JSF Testing with JMeter   
Mar 26, 2007 2:24 AM (reply 9 of 19)  (In reply to #8 )

 
I'm very interrested in what you made to make it works.
Could you tell me about that?
Thank you!
 
AD56
Posts:1
Registered: 4/2/07
Re: JSF Testing with JMeter   
Apr 2, 2007 9:49 AM (reply 10 of 19)  (In reply to #4 )

 
Some screen shots of what you did would be appreciated very much.

Thanks.
 
PSe000
Posts:14
Registered: 6/24/03
Re: JSF Testing with JMeter   
Oct 5, 2007 8:50 PM (reply 11 of 19)  (In reply to original post )

 
The solution is explained with MyFaces in the wiki, see http://wiki.apache.org/myfaces/PerformanceTestingWithJMeter

There is a minor change with JSF SUN RI, the hidden field has a different name, use a RegEx extractor (easier than XPath) with <input type="hidden" name="com\.sun\.faces\.VIEW" id="com\.sun\.faces\.VIEW" value="(.+?)" /> for the reference jsfViewState.
Replace the value of the request parameter com.sun.faces.VIEW with ${jsfViewState} in all your requests you have recorded.
 
benboss
Posts:1
Registered: 1/16/08
Re: JSF Testing with JMeter   
Jan 18, 2008 2:49 AM (reply 12 of 19)  (In reply to #8 )

 
Hi!

You can post figure examples about what you made to make it works.
Because I have problem when I Test a JSF application with jmeter . I look forward to.

Thanks very much!

Regard,

thaihv.
 
DGO
Posts:1
Registered: 2/15/08
Re: JSF Testing with JMeter   
Feb 15, 2008 12:29 PM (reply 13 of 19)  (In reply to #1 )

 
Of course it is not for funtional testing, but if you have various jsf blocks at the same time in a page, JMeter only records the activity of the first one. I need to separete the activity of each block, with their own session variables in distinct JMeter http requests.

Who in this world can help me with that!!!!


PD: Sorry for my english
 
PSe000
Posts:14
Registered: 6/24/03
Re: JSF Testing with JMeter   
Apr 11, 2008 6:08 PM (reply 14 of 19)  (In reply to #12 )

 
I have also posted in the JMeter wiki some comments about this.

Edited by: PSe000 on Apr 11, 2008 6:08 PM
 
This topic has 19 replies on 2 pages.    1 | 2 | Next »
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 27
  • Guests : 138

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums