【问题标题】:How to extract token value for authentication in Jmeter如何在 Jmeter 中提取用于身份验证的令牌值
【发布时间】:2015-08-23 01:50:20
【问题描述】:

我想从响应数据中提取一个标记值。我使用正则表达式提取器来获取VIEWSTATE & EVENTVALIDATION 值,但我还需要从下面提到的响应中获取'8579B772905C87F270BC7E7D648572A5AB55D1B7E7FB7EA2C33F8281125935EEE3D12D705E3ED1EBE59D4B66C90738FC11B087AD5D123DEAE5C29DD57218B107' 值:

<input id="btnSubmit" type="submit" name="Login" value="Login" class="login_N" onclick="

var pattern_Null = '^ *$';
var reg_Null = new RegExp(pattern_Null);

if(reg_Null.test(document.getElementById('txtUserId').value)){
    alert('Enter the Login Name');
    document.getElementById('txtUserId').focus();
    return false;
}

if(reg_Null.test(document.getElementById('txtPwd').value)){
    alert('Enter the Password');
    document.getElementById('txtPwd').focus();
    return false;
}

var s = document.getElementById('txtPwd').value;

document.getElementById('password').value = Encrypt(s,'8579B772905C87F270BC7E7D648572A5AB55D1B7E7FB7EA2C33F8281125935EEE3D12D705E3ED1EBE59D4B66C90738FC11B087AD5D123DEAE5C29DD57218B107','10001');

【问题讨论】:

    标签: jmeter


    【解决方案1】:

    这应该可行:

    加密(s, '([^']+?)')

    在模板字段中使用 $1$

    【讨论】:

      猜你喜欢
      • 2017-06-13
      • 2018-04-12
      • 2017-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-26
      • 2019-01-22
      • 2017-05-30
      相关资源
      最近更新 更多