目录
7.HTTP Request Post Content-Type设置
1.简介
为什么对Jmeter的配置文件进行一下讲解了,因为有的童鞋或者小伙伴在测试中遇到一些需要修改配置文件的问题不是很清楚也不是很懂,就算修改了也是模模糊糊的。更有甚者觉得那是禁地神圣不可轻犯不敢触碰不敢修改,害怕修改错了Jmeter运行不了了。大胆修改大不了再重新安装一个新的Jmeter,或者你有做备份的好习惯,在修改前备份好以后大胆修改,修改错了直接使用备份文件恢复过来就可以。
2.配置文件
在%JMETER_HOME%\bin(or $JMETER_HOME/bin)目录下搜索框中输入:properties 会发现存在多个配置文件,如下图所示:
宏哥接下来将按照其的重要性的先后顺序进行一一讲解和说明,其中最重要的是jmeter.properties.是Jmeter核心配置项文件,下面对其常用的一些配置项的设置进行总结与说明.
2.官方建议
将需要修改的属性值,复制粘贴到同目录下的 user.properties ,这里就是简单的提一下,后边再介绍user.properties文件
好处:当Jmeter升级时,可以避免修改项需要重新应用
3.jmeter.properties文件
由于这个文件太大了,宏哥在这里就翻译了其中的一部分,有兴趣的可以全部翻一下看看到底都是干什么的。
3.1文件许可证说明
3.1.1第1段——许可证说明
(1)原文
################################################################################ # Apache JMeter Property file ################################################################################ ## Licensed to the Apache Software Foundation (ASF) under one or more ## contributor license agreements. See the NOTICE file distributed with ## this work for additional information regarding copyright ownership. ## The ASF licenses this file to You under the Apache License, Version 2.0 ## (the "License"); you may not use this file except in compliance with ## the License. You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License.
(2)译文
# 示例user.properties文件 # ## Apache软件基金会(ASF)下一个或多个许可 ## 贡献者许可协议。请参阅 ## 此作品用于获取关于版权所有权的附加信息。 ## ASF根据Apache 2.0 版本许可证协议将此文件授权给您。 ## (“许可证”);除非符合以下条件,否则不能使用此文件 ## 许可证。您可以在 ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## 除非适用法律要求或书面同意,软件 ## 根据在“AS IS”BASIS上分发的许可证基础上发布的, ## 无任何明示或暗示的保证或条件。 ## 有关管理权限的特定语
3.2文件修改说明
3.2.1第2段——用于说明jmeter.properties文件
(1)原文
################################################################################ # # THIS FILE SHOULD NOT BE MODIFIED # # This avoids having to re-apply the modifications when upgrading JMeter # Instead only user.properties should be modified: # 1/ copy the property you want to modify to user.properties from jmeter.properties # 2/ Change its value there # #################