Total Pageviews

Wednesday, November 30, 2011

Integration Jmeter with Selenium


1) Write the selenium  junit test code for functionality  of your application.   Code should be error free.

2) After the test case is successfully run, we will get a .class file in bin folder.

3) Make jar of .class file and .java files. This can be done by doing the  following steps in Eclipse :
Go to File --> Export --> java --> Jars--> next --> browse location -->  Finish   

4) Copy and Paste that jar file under jmeter installation path /jakarta-jmeter-< version >/ lib/junit

5) Copy and Paste selenium-java-client-driver.jar and selenium-server.jar files under jmeter installation path /jakarta-jmeter-<version>/lib

6) Start jmeter

7) Create a test plan  in JMeter by following below steps . 
Click on test plan --> add thread groups and Go to Thread group--> Add --> Sampler --> Junit request

8) Under class name, we can check our package .class name. Select that particular .class file. 

9) Run the test plan. Now we can observe that selenium junit test cases will be running with multiple number of users at a time

1 comment: