There are many ways to encode a string in Loadrunner. I
already have explained the one using password encoder tool. Below is another
way to encode the string but this will convert the plain string to URL format.
Let’s see how, in this I have defined a
function EncodePlainToURL() which accepts a string and encodes it to URL
format.
char *EncodePlainToURL(const char *sIn, char *sOut)
{
int i;
char cCurChar;
char sCurStr[4] = {0};
sOut[0] = '\0';
for (i = 0;
cCurChar = sIn[i]; i++)
{
if (isdigit(cCurChar) || isalpha(cCurChar))
{
}
else
{
sprintf(sCurStr,
"%%%X", cCurChar)
}
strcat(sOut, sCurStr);
}
Action()
{
char
sOut[100];
return
0;
}
No comments:
Post a Comment