Total Pageviews

Tuesday, 8 October 2013

How can we pass cookie from one thread to another in JMeter.

Some time we need to make multiple requests after Login in application in such case we should create test plan as:

1. Create a test plan with two thread groups.
2. First thread group should be SetUP thread group which will run once in starting of the Test Plan run.
3. Add a HTTP request sampler for Login request in first thread group.
4. Add a Bean-Shell Post Processor with the request for getting the cookie from response after making login like:









5. Add a HTTP request sampler in second thread group for target request which we want to hit multiple time.
6.  Add a Bean-Shell Pre Processor with the request so that we can pass cookie value in request like:


Now run the test plan.



Thursday, 12 September 2013

Maven with CPD, CheckStyle, FindBug, PMD


Integration of CPD, CheckStyle, FindBug, PMD with Maven

We can integrate all these code checking tools within Maven. We just need to add all plugins with <reporting> tag in pom.xml.

Sample code is here:

 


We need to hit target "mvn site" for run these tools by command line.

All reports will be generated at location "<project folder>\target\site" folder.

FindBugs require compilation of code so we have to run target "mvn clean compile site".