Jmeter-测试计划功能测试模式
Jmeter- Test plan Functional test mode
我尝试在 Jmeter 中使用功能测试模式。但是找不到任何区别。
如何在 Jmeter 中使用功能测试模式?它在哪里存储 Response 和 Sampler 数据?
如果您 运行 使用 JMeter GUI 进行测试 - 无处可去。结果保存在内存中,可以使用 View Results Tree listener
可视化
根据 documentation,您只会在以下情况下看到差异:
您将以下行添加到 user.properties
jmeter.save.saveservice.output_format=xml
运行 JMeter 在命令行非 GUI 模式下,如:
jmeter -n -t test.jmx -l result.xml
如果取消勾选 Functional Test Mode
- 只有基本信息将存储在 result.xml
文件中(根据 results file configuration 中指定的内容 - 参见 ),即
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<httpSample t="298" it="0" lt="297" ct="54" ts="1540368444288" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="1597" sby="115" ng="1" na="1">
<java.net.URL>http://example.com/</java.net.URL>
</httpSample>
</testResults>
如果勾选 Functional Test Mode
- 所有内容都将存储在 results.xml
文件中,包括请求和响应的详细信息:
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<httpSample t="176" it="0" lt="176" ct="43" ts="1540368457253" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="1613" sby="115" ng="1" na="1">
<responseData class="java.lang.String"><!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 50px;
background-color: #fff;
border-radius: 1em;
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
body {
background-color: #fff;
}
div {
width: auto;
margin: 0 auto;
border-radius: 0;
padding: 1em;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is established to be used for illustrative examples in documents. You may use this
domain in examples without prior coordination or asking for permission.</p>
<p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
</responseData>
<cookies class="java.lang.String"></cookies>
<method class="java.lang.String">GET</method>
<queryString class="java.lang.String"></queryString>
<java.net.URL>http://example.com/</java.net.URL>
</httpSample>
</testResults>
更多信息:
我尝试在 Jmeter 中使用功能测试模式。但是找不到任何区别。 如何在 Jmeter 中使用功能测试模式?它在哪里存储 Response 和 Sampler 数据?
如果您 运行 使用 JMeter GUI 进行测试 - 无处可去。结果保存在内存中,可以使用 View Results Tree listener
可视化根据 documentation,您只会在以下情况下看到差异:
您将以下行添加到 user.properties
jmeter.save.saveservice.output_format=xml
运行 JMeter 在命令行非 GUI 模式下,如:
jmeter -n -t test.jmx -l result.xml
如果取消勾选
Functional Test Mode
- 只有基本信息将存储在result.xml
文件中(根据 results file configuration 中指定的内容 - 参见 ),即<?xml version="1.0" encoding="UTF-8"?> <testResults version="1.2"> <httpSample t="298" it="0" lt="297" ct="54" ts="1540368444288" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="1597" sby="115" ng="1" na="1"> <java.net.URL>http://example.com/</java.net.URL> </httpSample> </testResults>
如果勾选
Functional Test Mode
- 所有内容都将存储在results.xml
文件中,包括请求和响应的详细信息:<?xml version="1.0" encoding="UTF-8"?> <testResults version="1.2"> <httpSample t="176" it="0" lt="176" ct="43" ts="1540368457253" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="1613" sby="115" ng="1" na="1"> <responseData class="java.lang.String"><!doctype html> <html> <head> <title>Example Domain</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style type="text/css"> body { background-color: #f0f0f2; margin: 0; padding: 0; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } div { width: 600px; margin: 5em auto; padding: 50px; background-color: #fff; border-radius: 1em; } a:link, a:visited { color: #38488f; text-decoration: none; } @media (max-width: 700px) { body { background-color: #fff; } div { width: auto; margin: 0 auto; border-radius: 0; padding: 1em; } } </style> </head> <body> <div> <h1>Example Domain</h1> <p>This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.</p> <p><a href="http://www.iana.org/domains/example">More information...</a></p> </div> </body> </html> </responseData> <cookies class="java.lang.String"></cookies> <method class="java.lang.String">GET</method> <queryString class="java.lang.String"></queryString> <java.net.URL>http://example.com/</java.net.URL> </httpSample> </testResults>
更多信息: