如何关联LoadRunner 12.02中Worklight服务器响应字符串在响应中发送的两个相同编码变量?

时间:2015-06-04 18:13:24

标签: correlation loadrunner

我正在尝试针对在网络和移动设备上使用的某个应用程序创建负载测试。我想从网上访问这个应用程序。我登录网站了。使用此登录信息,我单击该应用程序的Web版本。以下回复在此处返回。

此应用正在使用SiteMinder和Worklight与我来自的主要网站进行协商。

我的问题是,当在同一个字符串中返回TWICE时,如何关联诸如'SMIDENTITY ='之类的值?

以下是服务器返回内容的示例(我已经分解了字符串,因此变量是分开的:

  

Test4.c(225):
  饼干:testcookie =奥利奥;

     

SMIDENTITY = Cq16kwJwrJWgBd5zQ8ci0kP8IEZ47kftOxMr1wVsxx + W / 7sGS92ZA9zu69GRpolh0PRX97bvfHRya0m1ty1E07qR0HjKKXE8ypRsWPgG4m2w8mlspPUxL8t5Z4RE5 / CCJpOxpXHIHeQK4f77gkihKFq8cBQr + Vy9kZGFGMUJH6 + EiLNmmJT + XYZcUi7gzV0r + naJypMewtXAYaOcvn8Kqsu2JA5SiNUcJbxxX4dNCHOsC4cf45Jm0H40Efq6nOwN7MDyAE2gXSou4oa9ZlYxlsvWdEVl6CxgnqnqEkBJYVuBsgj / 277 + F7q9KB4xpct / sYvRT9CR / Rvh79hmpJJedH + lA8A6UtqyA21CnECQJzrbKJJgx3eeyN86BQv3g / kOWJ2CE4txEn22U + AjMKmxgB7fmLTNdxKS5 + sn9P / Fs的TGwhRSX3pr / l1h4NQpNzb1Rz1fbt80 / ODWbLSlBFBmQTCCRkLx54dcR40lH0iDl9543KZCAphpzKXS429ZZyCH00xdITd4vpab / l9cWZEHuoJFbgf4yWmx6eGo6zdPxb6Yv / D2EM9GnXnWsF14lrI4XtlreE + 9o3EXSTbbz + MHH / YM / LzA4zaul4luiPMUNAnP + qatTR9WvK1NsC2KgsQl;

     

_ga = GA1.2.653519056.1433336304;

     

test_pol = UQEpK70TB9Ps6k9Zn0ZxC / WTTWAF7 + 1iJrMLhMAAA7SYUNDT9zue / krOWPgYi0yqdM6KUELeseH7xg ==;

     

prismdc = prism1;

     

SMSESSION = CsYLjBNgLxl / cD1kJbxQdF2SAmFOE70rad51OQMLm1DQPcD2KYey2K05r4s8s9WFfEwLt2 + wJweUR + MAf4Vq4v0ENDwm0ciXQ3jWEZheBbcugYPeUmAIPOIs21aBJxlPTCIXXpfmUhPFHOZnTEm7zsR1Hh9Y9gP9JB451iVsjRsojcwZGXwY3B7SqdMv2yDWnEebraDsiynDWadg63bIdoEvlPoVU0bPXbxKi5 + F88PDB8S886UIWBfITiB8h2ETyNnKVFUm6l8Isyd68g8xwnExdbgBC4RYMhaeRulPKtYBKbMckwp6Wn0l125RGhqXayU7XLz7PvcsIqEZfxHFqD02kA0g6FNvBpCY1DY0TWn1FvnDNGyAzfDOclLIy78w1kDfL0FJ9G49LdJJJbpdmFkHSk1SCul8Hi5kvaxxntj8D4dEt / L4D1biLL + d6Wtzxqr + 7qYS4SSY0ns / q2xOvmxJFulp + 0cND2XZUDRH5LrSiVuQxZqa5hNJNfUkHRcNKveO5LJ / + bPPUyIWKplN1vTpS1 / GoAZ88P3fAzVgNRBjrYZhOTJxRBAEAgd5CHAy1jjg + oH02xMZ1aPZ6TzKHU6QQFfrsgBqOjSPgMf / 42MsyrO5TiXWSLgfttdCbReyF3j + JC / wA0a5UrVNtsqA3PTNvPtw + ctC8zwG73xHGOP + tMyupdIFhIwW5kvGMAKJWq4dsVq4QRGjd5kqUxIUDfN5TPcHHSzws4exH0F2VwxdmM3 / VapwlwCvX5GOH78wGThIg6dxC2Ymib6nkB33wNbb4WlnZa23kkZYMjglBJj1HsTBMBF4mlkRwsWtRTXBlZSO7h34qjnDlkBI6FMeDO687pNaCo7a3QP7NkqLmwOps1CGgE1H3HRNHHbOu4trRlYdn2P1tBJLJFdf2vltWs75ZXi3duSIjAYqAz1DVqq2elqvREyP8 + r34MQnSOKZG + fsTHGikOXuN8wAWOnohHJ2dYh vbXnQ7MnMlF0jac814HGzsWV74lH4zBijMMxh;

     

SMIDENTITY = Znq + Rjv7MGdt9xtb + 8uGlTTdQZ9iYv6wGHXLdmFtwBycXLBJW8yDWKGSMWcsEzDS4HiatqOMOkvr6MrvozpzdChfri8omqI1NEQoNROSwOtyNzAkw + bz5JNKxvMYFCqPW / 1PsUqFCG9TdOLxopxyza8JlCZIFs4XNmO0isgW7QwqCRYmGcwniMjfUMhrG87O6dU + / bOdxr6QrETp6QzLFxE / gdk1t4MqyUhdfWJA + BwRLQLj5DDasAYsRm0FegIbeqLgZDnLE9I + LbMpspcs / uAxngT7vLfvR + g7Ww9CpYbDx7KAernW7PzuzDuxwwKTr + ImolLUtc7eka1wl6wsdD7 + jEDTnHda4wNVJjLoXldeAr6cJ2N1RF9UpjQkmDcaWTWU9v0ejB6 / YZwKby8dRUuEH90BoSe + JICC / XHi5kq6w10P5r0 / c0uZbgxrNAo8X + WW / QQUyOgsCVzila6z6Gef7zPgBw9lRjV5rYZlO97h3DEPgQoLNHLIummOdcJk84u9RfD68wk + ​​3J2tbvKNj0O0ib5qapmJ3b7zXdmHW9KCHLz7MBMLl7tznaLyUoCSt + BQL8O / NfvpCmV6Rn5UEmeqLZXGaGzszc7oy + 08WaGwGE7 + dEEZmmC / httCy1bj;

     

LtpaToken2 = D8P5upMb3r8v + VXraUoNZUCh08z0wKI466bDTnYEkrV9jS1Y6FOIYGyU18ETtFWxXBsyIizXZ2d9JmHTTFaBIpxhqHceufkDohe / dQoDPkiQgMmxGrX1IobPmb0tYgD2yrLh7TkxpBTt5nXn2isK2PVAk4a0zT / qa0g4huq457lH3CDLQF + jj8w9qB2 / gSVlWXKX0SKHNd2YJ2mBrc4j7oBOE8GOXiJlH8B5qnKvX99aYIdKxXoNILDBfK / RFaGWIy34uLNVRjOkZcUkKCBVB0D83GIj2EM2YqFs + GuWnRKvW7woAGIN69j7T50NWoIF / TPmdCnCM1HEfxhHfqxK0u5PUKheZeKNXqepoNIEb5ry1QGBho0OAeXQvlYeXiPZfKknu66iJpPEQaIpj0csWThztytn7uDuAiTCPZ4Yhwm + 6pYHhxp7Jx / U84L2u3M7BamqD + oiCrFaYpMXkCGHw99hbHhE1okP3q +血红蛋白/ TCODKwIG80lw7660Y + nFGMIaCreNeu0Em + dY7rTU + KubyJqeYtt / NssB1Qq945MShkhix + KDKE + ViNmmyRqyUQpTEx6fXgbJQihm7KguDfOJSxvsalaO3vAwwN / mJTSxcRVktIaAYT4ZcakZS5r / mLRVllQmOczO4Ex2zAgflcEZ3GUlG3 + TuL6JCYVWI3haAa0wUWffLCYRPo 2 / N 2 + 4vl5v / x9HkTXIZe0p4JCS1nWpzZXsg ==;

     

LtpaToken中= EHYGd9YV18oZsd8vSkJGm6EitmZCspgF2RbWMb / kDol6urQ8ZBeespgw8VR0jXPkwKdnAQjJ5x4ZdmTexnZiL3QIVzdH + DwWbTNP4KBAe / cdizYf8 / 0w05B9N13YX4rT7xl / Y0ZUhZX1brNgM7zP19a4IjL0E0M5uK2qah9ggErQhovcziPkA6Uubd4ne5keV / H / S0ZdaRMSjhXp6njlRtJl6C2U5r91YTXYVnbnl + sgG88g9jnPa6 + PEG + yi4P9VeoSohydoAIrqBGbpr7yL9ocaO3dL6bq / Ff6WAWZuca1V + 7 + x4bxtWHQ2CgafibbAkowunOsCyHvCRbv2FH8MQ ==;

     

JSESSIONID = 0000QLn5MU6tB5uMM0bXlOC8ZYS:15b4l3mm8;

     

SITE_ENTRY_JUMPTO = polhome;

     

记分牌= “”;

     

scoreboardReport = “”;

     

WLSESSIONID = 0000Xr6ZS67VI4UH-HoycrnVBq1:18lm04lom \ r \ n

2 个答案:

答案 0 :(得分:0)

使用您需要作为集合一部分的变量实例的序号(或索引)

有关序数值的相关函数,请参阅培训材料或在线帮助

答案 1 :(得分:0)

你没有说出你真正想要做的事情。你只需要使用最近的吗?只使用第一个?

使用web_reg_save_param_ex捕获参数的所有标准。它将它放入一个数组中。 然后,您可以使用该阵列执行所需的操作。 您还可以使用web_reg_save_param_regexp

我处理了官方文档中的代码,并将变量名称放在那里,以方便您使用。

web_reg_save_param_ex(
    "ParamName=SMIDENTITY", 
    "LB/IC=SMIDENTITY=",
    "RB/IC=;",
    "Ordinal=all",
LAST);

web_submit_data("...");

/*     Getting individual elements from a parameter array.
    Since the parameter created by web_reg_save_param_ex 
    is called "SMIDENTITY", the number of elements
    is saved in parameter "SMIDENTITY_count".
    The array elements are parameters "SMIDENTITY_1",
    "SMIDENTITY_2", ... "SMIDENTITY_n".
*/

elemCnt = atoi(lr_eval_string("{SMIDENTITY_count}"));

lr_output_message("Number of items found = %d",elemCnt);


for (x=1;x<=elemCnt;x++) {
    sprintf(arrayParamName, "{SMIDENTITY_%d}", x);
    lr_output_message ("%s: %s",
        arrayParamName,
        lr_eval_string(arrayParamName)); 

}