Saturday, December 14, 2013

Record JMeter Testing Script for ZK


Simple Note

Tested with JMeter 2.9 and ZK 6.5.2

* Input address and port in HTTP Request Default so they will not be recorded in request and can be changed easily if address/port are changed.

* Need to remove UserDefinedVariable (dtid: 0) before each record then add it back.

* Add parameter tdtid: ${__intSum(${dtid},1,dtid)} to the request for loading page

* Change parameter dtid to ${dtid} for each au request.

* Included pattern:
    .*/zkau.*
    .*\.zul
    .*/TestProjForJMeter.* (for welcome page or any other url matched by servlet, index.zul here)

* Excluded pattern:
    .*/zkau/web/.* (ignore the requests for load resources)

Record Demo

http://screencast.com/t/4rUMLerhQg


Recorded requests:

1. Page load

2. Click "click to start tast"

3. Click "increase first intbox"

4. Click "increase second intbox" (it is wrong in the demo, fixed in latest project)

5. Click "increase first intbox" again

6. Click "increase second intbox" again

7. Remove desktop

Reference

ZK Document
http://books.zkoss.org/wiki/Small_Talks/2012/January/Execute_a_Loading_or_Performance_Test_on_ZK_using_JMeter

JMeter User Manual
http://jmeter.apache.org/usermanual/functions.html#__intSum

Download

Testing Project
https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/TestProjForJMeter

Demo Flash
https://github.com/benbai123/ZK_Practice/blob/master/General/JMeter/demo/SimpleRecord.swf

Jmeter Script
TestSimpleRecord.jmx at https://github.com/benbai123/ZK_Practice/tree/master/General/JMeter/jmeterTestingScript

No comments:

Post a Comment