【发布时间】:2019-05-14 02:49:41
【问题描述】:
我已经完成了很多从第一个请求的响应中提取值并使用正则表达式/CSS 提取器等传递给后续请求的情况,但现在我想在 GET 处提取一个值并将其传递给相同的 GET(当我单击我的页面会生成一个随机代码,该代码必须传递到同一页面,此代码对于每次点击都是唯一的)。如何创建变量并存储代码值并传递?
如何在运行时从 jmeter 中的请求中提取 GET 值并将其作为变量传递。我想在同一个请求中将此值作为变量传递 看下面的截图
我用于加密/解密的 C# 代码如下 -
string handlerPath = HttpUtility.UrlEncode(appPath + "/ReportFileUpload.ashx");
string cipherText = string.Empty;
string passPhrase = "!MMFileUploader123"; // can be any string
string initVector = "2038459710286532"; // must be 16 bytes
// Before encrypting data, we will append plain text to a random
// salt value, which will be between 4 and 8 bytes long (implicitly
// used defaults).
RijndaelEnhanced cipher = new RijndaelEnhanced(passPhrase, initVector); //, 4, 16, 256, "SHA1", DateTime.Today.ToBinary().ToString());
cipherText = cipher.Encrypt("?rn=" + repNum + "&uid=" + user.UserId + "&op=" + originPath + "&hp=" + handlerPath + "&p=" + pass + "&domain=" + domain + "&org=" + org + "&entitytype=" + entityType);
cipherText = HttpUtility.UrlEncode(cipherText);
//解密
//破译代码获取参数并赋值给inParams
string passPhrase = "!MMFileUploader123";
string initVector = "2038459710286532"; // must be 16 bytes
RijndaelEnhanced cipher = new RijndaelEnhanced(passPhrase, initVector);
string cipherText = HttpUtility.ParseQueryString(
ApplicationDeployment.CurrentDeployment.ActivationUri.Query)["code"];
inParams = cipher.Decrypt(cipherText);
【问题讨论】:
标签: jmeter