1

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?

5
  • Unbelievable. It has nothing to do with the code itself, the problem was that the script name contained a dot and a space. When I recorded the script again with the name "1_MyScript" instead of "1. MyScript", LoadRunner behaved as intended. I couldn't believe this was the cause, but I've tried with several new scripts and it is: LoadRunner doesn't like dots or spaces in script names -maybe is only one of them that it doesn't like, but from now on, I will avoid both.
    – Johnbo
    Commented Aug 29, 2012 at 9:11
  • 1
    doesn't surprise me in the least. For a long time even group names longer than 16 characters were problematic in the controller. I tend to stick with underscores if I need a space and keep my names short just in case some older code sneaks back in accidentally into a patch release. LoadRunner is not alone, all the historic performance tools have their evolutionary quirks, leftovers from two decades of release cycles. Commented Aug 29, 2012 at 15:10
  • @JamesPulley, Isn't selenium much better since it's opensource? Loadrunner seems to be really bad, crash-all-the-time, and the official documentation is always half-complete without mentioning edge cases.
    – Pacerier
    Commented May 15, 2015 at 22:43
  • Selenium is a functional testing tool. From a functionality perspective it is not even as complete as WinRunner or XRunner of 1996 in terms of built in capability. Running functional tools en masse for load is state of the art as of 1992-4. Since that time the market shifted to API level, operating at the bottom of the OSI application or in the OSI session layers, accurately reproducing load to the server with a lighter resource footprint per virtual user. Commented May 16, 2015 at 20:30
  • I have no idea what you mean about official documentation saying that it half complete..... There is no glory in open vs closed source, unless you plan on modifying the source. Every project is a combination of tool and labor. The open source tools all require a higher labor quotient than their commercial counterparts for test production, collection of monitor data and analysis. Rarely is this difference in labor cost taken into account when evaluating the tool cost Commented May 16, 2015 at 20:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.