Jmeter of interface testing process

Jmeter use of interface testing process 

 

  First, the tool uses detailed - jmeter

  1, commonly used test Original:

  Test Plan: Default

  Thread Group: concurrent, concurrent time, the number of concurrent

  Sampler: the more common HTTP request, JDBC Request, SOAP / XML -RPC RRequest

  Listener: See the results tree

  Assert: in response to assert the response data returned by the server comparison, determines whether the request is successful

  Configuration elements: user-defined parameters

  Post Processor: Regular Expressions

  2, open jmeter, test a project, you need to add a thread group, as follows:

  3, after opening the thread group, with emphasis on: the number of threads, Ramp-Up Perlod (in second), the number of cycles: thread under the property.

  Thread Attributes: stress testing , performance testing are associated

  Threads: can be understood as the number of users, number of virtual users (default is 1)

  For example, to do a concurrent tests need to simulate 100 users, (fill in the number of threads back 100)

  100 users simultaneously request access concurrently

  Ramp-Up Perlod (in second) start time: for example, all 100 users start time

  (In seconds), the time to start within one second user 100

  Cycles: the cycle of times each user

  4, in order to finance the project, for example, now need to do a interface testing , add common HTTP request in the thread group, the default request name for the HTTP request (name can modify their own test module)

  5, then add the HTTP request, the content according to their actual situation to fill in, for example here, for reference only:

  Fill reference parameter transmitted own interface use cases.

  6, in order to clear each successful or failed the test, you can add a monitor, monitor the content of the test, to be added here is that -> View results tree

  Right-click - Add - Listener - after viewing the result tree, the addition is complete, as follows:

  7、测试是否正确,点击Jmeter上面的绿色执行按钮,并同时打开察看结果树界面,如下所示:第一次运行,会弹出一个窗口,如果需要保存直接点击“是”,不保存就点击“否”

  8、这里看到返回的结果是ok,说明这个接口测试没有问题。

  二、jmeter参数化三种方式

  1、函数助手中的函数获取参数值 _Random函数 _RandomString函数

  2、用户定义的变量

  3、配置元件 CSV Data Set Config

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/sunlaoshi/p/11447187.html