我想使用JMeter提取result.TotalSessionCount
。我尝试使用常规提取器。似乎常规提取器只能提取DOM中的元素。关于如何提取JQuery脚本中的某些变量的任何想法?
下面的代码来自检测工具
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="x-ua-compatible" content="IE=11, IE=Edge" /> <!-- Use Internet Explorer 11 and above Standards mode -->
<title>Instrumentation Data</title>
<script type="text/javascript">
var urlToGet = "/OnPremise/Core/Instrumentation/Get";
var instruAjax = {
call: function (actionUrl, succussCallBack) {
$.ajax({
type: "Post",
url: actionUrl,
data: {},
success: succussCallBack
});
}
};
var instruSuccess = {
get: function (result) {
$("#sessionPoolData").text("");
$("#sessionPoolData").append("Session Pools ( Total : " + result.SessionPools.length + " ) - Sessions ( Total : " + result.TotalSessionCount + " )"); // extract this, result.TotalSessionCount
// More code
}
};
$(function () {
instruAjax.call(urlToGet, instruSuccess.get);
});
</script>
</head>
<body>
<div id="sessionPoolData">
</div>
</body>