Jmeter recording web and app script

Front:

First, have installed jmeter

 

step:

First, open jmeter, right-testing plan -> Add to add a thread group -> thread -> thread group, the new thread group

 

Second, the right thread group -> Add -> Controller Logic -> Record controller, add recording controller

 

 

Third, the right thread group -> Add -> configuration elements -> HTTP Cookie manager, add HTTP Cookie manager

 

 

Fourth, the test plan right -> Add -> non-testing element -> HTTP proxy server, add the HTTP proxy server

 

The default port number is 8888 and can be modified according to the situation

 

Fifth, the right HTTP proxy server -> Add -> Timer -> Gaussian random timer, add a Gaussian random timer (each thread in a random pause time before the request, the following figure represents the pause time will be distributed to 100 ) 400

 

 

 

Six, web browser proxy configuration (with the Chrome browser, for example)

Open chrome -> Settings -> Open Advanced -> System -> Open Proxy Settings

 

 

Click the "LAN Settings" -> check "Use proxy server for your LAN", as you can configure the port number and Jmeter

 

Seven phone configuration proxy

Phone wifi connection settings, set Jmeter client's IP address can be

 

Eight, start Http proxy server

 

Click OK to the pop-up box content, generate a security certificate file in the bin directory jmeter: ApacheJMeterTemporaryRootCA.crt

 

 

Operates on a web browser or APP, Jmeter will involve the recording will go to the interface, click "Stop" to end the recording operation is completed

 

Nine, the recorded script execution

The results recorded script is as follows:

 

Right thread group -> Listener -> View results tree, add the result tree view

 

Click the Start button, record a script execution, tree observations by looking at the results after the end of execution

 

Other: Record HTTPS interface

Record web interface to the end of https

First, click on Options -> SSL management, secure credentials above start to record the generated ApacheJMeterTemporaryRootCA.crt import

 

二、浏览器导入证书(以Chrome浏览器为例)

设置-->高级-->管理证书

 

 

点击 受信任的根证书颁发机构-->导入-->下一步-->浏览jmeter证书-->证书存储为“受信任的根证书颁发机构”,下一步-->完成-->弹出的安全警告点击“是”即可

 

 

 

 

 

 

 

这样就可以录制web的https的接口了

 

录制APP端的https接口

1.通过QQ把jmeter的证书发到你手机上的QQ:

 

2.选择"用QQ浏览器打开"

 

3.界面会跳转到Safari里进行安装操作,点击允许操作

 

4.点击安装

 

5.安装完成

 

 

 

6.打开手机 “通用”-->“关于本机”-->"证书信任设置",把jmeter的证书勾选打开

 

 

7.这样就可以录制app上的https接口了

 

Guess you like

Origin www.cnblogs.com/lemon-feng/p/11190621.html