当前位置:网站首页>JMeter script FAQs

JMeter script FAQs

2022-06-24 02:41:00 User 8049856

1、 Use http cookie manager Get the... In the response header of the login interface cookie value ,cookie The reference variable name is correct , But what we get cookie No entry into force , Still reporting a mistake 401 reason :bin In the catalog jmeter properties File default cookiemanager.save.cookies=false, Acquired cookie Value not saved solve : Remove the comment from this line , Change to cookiemanager.save.cookies=true

2、 Run the login interface in batch to obtain a batch of valid cookie data , The login account and password are correct and not repeated , But the obtained part cookie Always expired reason : Used 2000 Account number and password , Keep running 5min, This leads to the recycling of these accounts and passwords , Resulting in partially generated cookie Be overwritten solve : In thread group loop count Not set to -1, It is set to the number of times , Run as many times , Ensure that each account generates a unique cookie

3、 Use csv Data files guarantee script parameterization , But from the dependent file uid The field value is incorrect , Still uid Isoparametric name reason : The parameter name is set in the first line of the dependent file , And in the csv The first row of... Is ignored in the setting false solve : When the parameter name is set in the first line of the dependent file ,csv The first line selection... Is ignored in the data file settings true; The parameter name is not set in the first line of the dependent file ,csv set selection false

4、coding Platform operation jmeter Script , Completion of task construction during pressure test , The script doesn't work reason : The script uses csv Data files , stay coding The file path is written incorrectly when executing on the platform :jmeter/xxx.csv solve : Change the path to /jmeter/xxx.csv, Here's the absolute path

5、coding Platform operation jmeter Script , After the pressure test grafana No pressure measurement data can be seen on the panel reason : The pressure test cluster of this project is configured with multiple namespaces , Only defalut Under the configuration of grafana Monitor dashboard , So in addition to defalut outside , Results executed under other namespaces are not displayed solve : Put... In the back-end listener influxdbUrl from http://jmeter-influxdb:8086/write?db=jmeter Change to :http://jmeter-influxdb.default:8086/write?db=jmeter

6、 The backend listeners under two different thread groups are set to Baidu 1 And baidu 2 Value , After operation grafana All the pressure test results in the panel are displayed in Baidu 1 in , Baidu 2 The data in is empty reason :jmeter A pit in ! In the source code “ Back end listener ” This name determines whether the listener is running ( Instead of its set value ), Because each thread group is consistent by default , Therefore, not actively changing the name here will cause all the listening data to be mixed in the first one solve : Different backend listeners have different names , for example : Back end listener -1: Baidu 1, Back end listener -2: Baidu 2 etc.

7、 The script dependency file is too large to upload to coding platform , adopt git Upload files ,push I always report mistakes when I'm on duty :rejected reason : The code inconsistency between the remote library and the local library results in solve : In execution push Before the command , Merge updates from the remote library to the local , Execute the following command :git pull --rebase origin master

原网站

版权声明
本文为[User 8049856]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/10/20211026173940793t.html