Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
221 views

state information is invalid for this page or might be corrupted

Hi,

Hope you are doing fine.

I am facing an error while replying the script in vugen "state information is invalid for this page or might be corrupted" how can i solve that issue? basically its asp.net website which is throwing that error. looking for help.

Best Regards

0 Likes
2 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Hi,

Kindly tell me how I can decode following lines. As I am having %2F %24 etc in my script. I want to replace %24 with $ according to book.

"Body=ScriptManager=dnn%24ctr408%24makePayment%24dnn%24ctr408%24makePayment%24pnlMakePaymentPanel%7Cdnn%24ctr408%24makePayment%24btnSubmit&__EVENTTARGET=dnn%24ctr408%24makePayment%24btnSubmit&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwULLTIwNTcyNTE4NDIPZBYGZg8WAh4EVGV4dAV5PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25hbC5kdGQiPmQCAg9kFg4CBw82VQYXltZW50JGJ0blN1Ym1pdAUrZG5uJGN0cjQwOCRtYWtlUGF5bWVudCRjdGxSZXR1cm4kYnRuQ29uZmlybQUeZG5uJGN0cjQwOCRtYWtlUGF5bWVudCR3bmROb3RpBSRkbm4kY3RyNDA4JG1ha2VQYXltZW50JGRycFB1cnBPZkNhdGcPFCsAAmVlZAUlZG5uJGN0cjQwOCRtYWtlUGF5bWVu%3D&__VIEWSTATEGENERATOR={__VIEWSTATEGENERATOR}&RadFormDecorator1_ClientState=&RadFormDecorator2_ClientState=&dnn_logout_winLogOut_C_btnLogOut_ClientState=&dnn_logout_winLogOut_C_btnNo_ClientState=&dnn_logout_winLogOut_ClientState=&dnn_TopMenu1_RadMenu2_ClientState=

and after decoding how can i correlate that decoded value?

Best Regards

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hi Mike,

Please follow below steps:

Step 1: First complete the correlation and store the value. Eg. Assume if we are storing the values in c_CorrelationValue.
Step2 : In Action, put below code.

lr_save_string(lr_eval_string("{c_CorrelationValue}"), "Mypar");

// Replace the %20 characters with $
//Here lr_replace is custom function
lr_replace("MyPar", "$", "%20" );

// Output new result
lr_output_message("%s", lr_eval_string("{MyPar}"));

//lr_replace function code here!

//Note: ******Copy and paste in global.h
//*** Replace function code**

char *strReplace(const char *src, const char *from, const char *to)
{
char *value;
char *dst;
char *match;
int size;
int fromlen;
int tolen;

// Find out the lengths of the source string, text to replace, and
// the replacement text.
size = strlen(src) + 1;
fromlen = strlen(from);
tolen = strlen(to);

// Allocate the first chunk with enough for the original string.
value = (char *)malloc(size);

// We need to return 'value', so let's make a copy to mess around with.
dst = value;

// Before we begin, let's see if malloc was successful.
if ( value != NULL )
{
// Loop until no matches are found.
for ( ;; )
{
// Try to find the search text.
match = (char *) strstr(src, from);
if ( match != NULL )
{
// Found search text at location 'match'.
// Find out how many characters to copy up to the 'match'.
size_t count = match - src;

// We are going to realloc, and for that we will need a
// temporary pointer for safe usage.
char *temp;

// Calculate the total size the string will be after the
// replacement is performed.
size += tolen - fromlen;

// Attempt to realloc memory for the new size.
//
// temp = realloc(value, size);
temp = (char *)realloc(value, size);

if ( temp == NULL )
{
// Attempt to realloc failed. Free the previously malloc'd
// memory and return with our tail between our legs.
free(value);
return NULL;
}

dst = temp + (dst - value);
value = temp;

memmove(dst, src, count);
src += count;
dst += count;

memmove(dst, to, tolen);
src += fromlen;
dst += tolen;
}
else // No match found.
{
// termination character.
strcpy(dst, src);
break;
}
} // For Loop()
}
return value;
}

int lr_replace( const char *lrparam, char *findstr, char *replacestr )
{
int res = 0;
char *result_str;
char lrp[1024];

// Finalize the LR Param Name
sprintf( lrp, "{%s}", lrparam);

// Do the Search and Replace
result_str = strReplace( lr_eval_string(lrp), findstr, replacestr );

// Process results
if (result_str != NULL )
{
lr_save_string( result_str, lrparam );
free( result_str );
res = 1;
}
return res;
}

Regards,

Regards,
Sakthirajan Kathirvel
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.