I've got a simple Login form in ASP.NET, and I saved the EventValidation and ViewState variables into parameters:
web_reg_save_param_regexp(
"ParamName=EventValidationParameter",
"RegExp=id=\"__EVENTVALIDATION\"\\ value=\"(.*?)\"\\ ",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=No",
"RequestUrl=*/Login.aspx*",
LAST);
web_reg_save_param_regexp(
"ParamName=ViewStateParameter",
"RegExp=id=\"__VIEWSTATE\"\\ value=\"(.*?)\"\\ ",
SEARCH_FILTERS,
"Scope=Body",
"IgnoreRedirections=No",
"RequestUrl=*/Login.aspx*",
LAST);
After loading the form, I submit it fulfilled with these two parameters, plus the username and password:
web_submit_data("Login.aspx_2",
"Action=http://myurl.es/Login.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://myurl.es/Login.aspx",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={ViewStateParameter}", ENDITEM,
"Name=__EVENTVALIDATION", "Value={EventValidationParameter}", ENDITEM,
"Name=logOn$UserName", "Value={UserNameParameter}", ENDITEM,
"Name=logOn$Password", "Value={PasswordParameter}", ENDITEM,
"Name=logOn$btnLogin", "Value=Entrar", ENDITEM,
EXTRARES,
"URL=/favicon.ico", ENDITEM,
LAST);
The problem comes when I try to replay the script, because LoadRunner isn't replacing the parameters so it sends their name instead of their value:
__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%7BViewStateParameter%7D&__EVENTVALIDATION=%7BEventValidationParameter%7D&logOn%24UserName=%7BUserNameParameter%7D&logOn%24Password=%7BPasswordParameter%7D&logOn%24btnLogin=Entrar
But they are correctly stored, as I can see in Run Time Data:
ViewStateParameter: /wEPDwUJNTkxMzQ5ODkyZGTb80dGltreV5eu7t3Sx4tukVlYVQ==
EventValidationParameter: /wEWBAKjqI3jCgKq8IegAwK5hoWUBwKTwO3qCT0Isk6sckIUnI6YemgcYsthpZpu
What is causing the parameters not to be replaced?
How can I fix this error?