APACHE jMeter TEST PLANS

From a previous post we talked about basic things about jMeter. From this post I’m going to talk about how to create different test plans for different scenarios. Let’s see them with examples,

WEB TEST PLAN

  • First right click on the Test Plan and add a Thread Group from Threads.

11

  • Rename it as what you like. I’m keeping other parameters as default.

12

  • Then right click on the Thread Group and add a HTTP Request from the sampler.

13

  • Change the name as you like.
  • Give the URL you want to test as the server Name.
  • Give the path as / to visit the home page.
  • Keep the protocol empty, so it’s http.

14

  • Now again right click on the Thread Group and add a View Results Tree from the listener.
  • Now click Run.

15

  • After it’s completing you can view the results from the Results tree.

16

17

18

19

20

DATA BASE TEST PLAN

  • I have created a new db and added a table and data to it like below.

30

31

32

  • Now let’s create a database test plan.

31

  • Here you have to add the JDBC driver to your test plan.

32

  • Then right click on the test plan and add a thread group.

21

  • Change it’s properties as below.

22

  • Next right click on the thread group and add a JDBC Connection Configuration from config elements.

23

24

  • Now you can add a JDBC Request from the sampler.

25

26

  • Finally add a listener as well.

27

28

  • Now you can run the test and check the results.

29

30

JMS TEST PLAN

Now check how to write a simple test plan to test Java Messaging Service (JMS). JMS supports two types of messaging,

  • Point-to-Point messaging − Queue messaging is generally used for transactions where the sender expects a response. Messaging systems are quite different from normal HTTP requests. In HTTP, a single user sends a request and gets a response.
  • Topic messaging − Topic messages are commonly known as pub/sub messaging. Topic messaging is generally used in cases where a message is published by a producer and consumed by multiple subscribers.

Here we are using Apache ActiveMQ as the JMS server.Yo can download it from the URL. Then extract it to anywhere you like and run it using following command.

40

Then using following link you can access the server. User name and the password are ‘admin‘.

41

JMS POINT-TO-POINT TEST PLAN

  • Now let’s create the test plan for point to point messaging.
  • Create a new test plan.

44

45

  • Add the Apache ActineMQ jar file.

46

  • Right click and add a Thread Group.

47

  • Change the properties.

48

  • Right click on it and add JMS Point-to-Point from Sampler.

49

50

  • Finally add a Listener.

51

52

  • Now you can run and test the plan.

53

JMS TOPIC TEST PLAN

  • Now let’s create a test plan for the next method.
  • Add a test plan.

60

61

  • Add jar files.

62

  • Add a Thread Group.

63

  • Change properties.

64

  • Add a JMS Publisher.

65

  • Change it’s properties.

66

  • Add a JMS subscriber.

67

  • Change it’s properties.

68

  • Add a Listener.

69

  • Run the test plan.

70

  • Check the results.

MONITOR TEST PLAN

Here what I’m going to do is sending requests to a server. I selected the tomcat server. Before proceeding we have to add a new tomcat user. Add the following to the tomcat-users.xml file at conf directory.

71.png

Now you can turn on your tomcat server. Then put the following URL on the browser and have a look.

http://localhost:8080/manager/status?XML=true

Again user name and password is ‘admin‘.

72.png

  • Now let’s create a test plan.

80

  • Add a new Thread Manager.

81

82

  • Add a HTTP Authorization Manager from config elements.

83

  • Do the following changes.

84

  • Add a HTTP Request.

85

  • Do the following changes.

86

  • Then add a Constant Timer from timers.

87

  • Do the following changes.

88

  • Next I’m adding a View Tree Listener and a Monitor Results Listener.

89

90

91

  • Now everything is good to go.
  • Run your test plan.
  • Check the results.

92

93

From this post we talked about creating different types of test plans. hope now you have a clear idea about Apache jMeter. Hope to see you soon with another interesting topic. Thank You!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s