1

I am having internal server error 500 while replaying script in loadrunner. I've tried several attempts to correlate the dynamic values using (Automatic & Manual) both of the correlation techniques but to no avail. My application is using cookies. Any help would be appreciated. following is the script snippet:

Action()
{
    web_set_max_html_param_len("99999");
    web_add_cookie("request_method=; DOMAIN=hcmorders.online");

    web_reg_save_param_ex(
        "ParamName=authenticity_token_1",
        "LB=type=\"hidden\" value=\"",
        "RB=\" /></div>\n",
        LAST
    );  

    web_reg_save_param_ex(
        "ParamName=authenticity_token",
        "LB=<meta content=\"",
        "RB=\" name=\"csrf-token\" />",
        SEARCH_FILTERS,
        "Scope=Body",
        LAST
    );

    web_url("hcmorders.online",
        "URL=http://hcmorders.online/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t1.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/2UX7WLTfW3W8TclTUvlFyQ.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/Hgo13k-tfSpn0qi1SFdUfT8E0i7KZn-EPnyo3HZu7kw.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/vzIUHo9z-oJ4WgkpPOtg1_esZW2xOQ-xsNqO47m55DA.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/RxZJdnzeo3R5zSexge8UUT8E0i7KZn-EPnyo3HZu7kw.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/d-6IYplOFocCacKzxwXSOD8E0i7KZn-EPnyo3HZu7kw.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/mnpfi9pxYH-Go5UiibESIj8E0i7KZn-EPnyo3HZu7kw.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/12mE4jfMSBTmg-81EiS-YRsxEYwM7FgeyaSgU71cLG0.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/7m8l7TlFO-S3VkhHuR0at4bN6UDyHWBl620a-IRfuBk.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/1pO9eUAp8pSF8VnRTP3xnvesZW2xOQ-xsNqO47m55DA.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/OLffGBTaF0XFOW1gnuHF0YbN6UDyHWBl620a-IRfuBk.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/t6Nd4cfPRhZP44Q5QAjcC4bN6UDyHWBl620a-IRfuBk.woff", ENDITEM, 
        "Url=http://fonts.gstatic.com/s/roboto/v15/bmC0pGMXrhphrZJmniIZpYbN6UDyHWBl620a-IRfuBk.woff", ENDITEM, 
        "Url=/assets/ico-search.png", ENDITEM, 
        "Url=/assets/banner-img.jpg", ENDITEM, 
        "Url=/assets/jquery-ui/ui-bg_flat_75_ffffff_40x100-e46a6c1c7b7986bfa7d7b953c6954fae.png", ENDITEM, 
        "Url=/assets/sep01.jpg", ENDITEM, 
        "Url=http://js-agent.newrelic.com/nr-971.min.js", ENDITEM, 
        "Url=https://maps.googleapis.com/maps-api-v3/api/js/26/0/common.js", ENDITEM, 
        "Url=http://bam.nr-data.net/1/183d9f179e?a=4629762&v=971.ec154e7&to=dVtfR0tXCF1VFB1BXkJRQhxQVgBUSA%3D%3D&rst=25135&ref=http://hcmorders.online/&ap=23&be=278&fe=24393&dc=22942&perf=%7B%22timing%22:%7B%22of%22:1471604314615,%22n%22:0,%22f%22:0,%22dn%22:0,%22dne%22:0,%22c%22:0,%22ce%22:0,%22rq%22:0,%22rp%22:0,%22rpe%22:249,%22dl%22:0,%22di%22:250,%22ds%22:23220,%22de%22:23292,%22dc%22:24655,%22l%22:24670,%22le%22:24672%7D,%22navigation%22:%7B%7D%7D&jsonp=NREUM.setToken", ENDITEM, 
        "Url=https://maps.googleapis.com/maps-api-v3/api/js/26/0/util.js", ENDITEM, 
        "Url=https://maps.googleapis.com/maps-api-v3/api/js/26/0/stats.js", ENDITEM, 
        "Url=https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttp%3A%2F%2Fhcmorders.online%2F&4sAIzaSyDoTpY0gsV3nOPP09Syri3ggq0k5xpib0o&callback=_xdc_._yevdd2&token=12718", ENDITEM, 
        "Url=/places/autocomplete?q=adams", ENDITEM, 
        "Url=https://maps.googleapis.com/maps-api-v3/api/js/26/0/places_impl.js", ENDITEM, 
        "Url=https://maps.googleapis.com/maps-api-v3/api/js/26/0/controls.js", ENDITEM, 
        "Url=https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictionsJson?1sadams&4sen-US&7scountry%3Aus&15e3&key=AIzaSyDoTpY0gsV3nOPP09Syri3ggq0k5xpib0o&callback=_xdc_._xq5jvb&token=3543", ENDITEM, 
        "Url=/assets/jquery-ui/ui-bg_glass_75_dadada_1x400-424d23ee315d459f86e0c5b2c1a0b58a.png", ENDITEM, 
        "Url=/assets/fontawesome-webfont-42e3b762e936182fccb762ea8ad638b1.eot?", ENDITEM, 
        "Url=https://csi.gstatic.com/csi?v=2&s=mapsapi3&v3v=26.0&action=apiboot2&libraries=places%2Cgeometry%2Cdrawing&e=10_1_0,10_2_0&rt=main.17", ENDITEM, 
        LAST);

    web_set_sockets_option("SSL_VERSION", "TLS1.1");

    web_url("channel.html", 
        "URL=https://js.stripe.com/v2/channel.html?stripe_xdm_e=http%3A%2F%2Fhcmorders.online&stripe_xdm_c=default133976&stripe_xdm_p=1", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=http://hcmorders.online/favicon.ico", "Referer=", ENDITEM, 
        LAST);

    web_submit_data("search_restaurants", 
        "Action=http://hcmorders.online/sites/search_restaurants", 
        "Method=POST", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/", 
        "Snapshot=t3.inf", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=utf8", "Value=✓", ENDITEM, 
        "Name=authenticity_token", "Value={authenticity_token}", ENDITEM, 
        "Name=restaurant_type", "Value=delivery", ENDITEM, 
        "Name=address_input", "Value=Adams Hall, University of Rhode Island", ENDITEM, 
        EXTRARES, 
        "Url=../assets/inner-search-icon.jpg", ENDITEM, 
        "Url=../assets/form-bg.jpg", ENDITEM, 
        "Url=https://csi.gstatic.com/csi?v=2&s=mapsapi3&v3v=26.0&action=apiboot2&libraries=places%2Cgeometry%2Cdrawing&e=10_1_0,10_2_0&rt=main.7", ENDITEM, 
        "Url=https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttp%3A%2F%2Fhcmorders.online%2Fsites%2Fsearch_restaurants&4sAIzaSyDoTpY0gsV3nOPP09Syri3ggq0k5xpib0o&callback=_xdc_._pgkq3y&token=47444", ENDITEM, 
        "Url=http://bam.nr-data.net/1/183d9f179e?a=4629762&v=971.ec154e7&to=dVtfR0tXCF1VFB1BXkJRQhxKXQVDUw5tQFJFQFBGS1kKRUM%3D&rst=9228&ref=http://hcmorders.online/sites/search_restaurants&ap=269&be=887&fe=8325&dc=396&perf=%7B%22timing%22:%7B%22of%22:1471604347131,%22n%22:0,%22u%22:798,%22ue%22:828,%22f%22:3,%22dn%22:3,%22dne%22:3,%22c%22:3,%22ce%22:3,%22rq%22:9,%22rp%22:795,%22rpe%22:796,%22dl%22:795,%22di%22:859,%22ds%22:1283,%22de%22:1294,%22dc%22:9190,%22l%22:9213%7D,%22navigation%22:%7B%7D%7D&jsonp="
        "NREUM.setToken", ENDITEM, 
        LAST);

    web_url("channel.html_2", 
        "URL=https://js.stripe.com/v2/channel.html?stripe_xdm_e=http%3A%2F%2Fhcmorders.online&stripe_xdm_c=default999994&stripe_xdm_p=1", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/sites/search_restaurants", 
        "Snapshot=t4.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=http://hcmorders.online/favicon.ico", "Referer=", ENDITEM, 
        LAST);

    lr_think_time(19);

    web_url("albies-place", 
        "URL=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/sites/search_restaurants", 
        "Snapshot=t5.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=http://bam.nr-data.net/1/183d9f179e?a=4629762&v=971.ec154e7&to=dVtfR0tXCF1VFB1AUkVAUEZLWQpFQ0lBWlhB&rst=1306&ref=http://hcmorders.online/restaurants/albies-place&ap=429&be=782&fe=517&dc=428&perf=%7B%22timing%22:%7B%22of%22:1471604375629,%22n%22:0,%22u%22:704,%22ue%22:726,%22f%22:1,%22dn%22:1,%22dne%22:1,%22c%22:1,%22ce%22:1,%22rq%22:700,%22rp%22:701,%22rpe%22:704,%22dl%22:701,%22di%22:747,%22ds%22:1209,%22de%22:1293,%22dc%22:1293,%22l%22:1298%7D,%22navigation%22:%7B%7D%7D&jsonp=NREUM.setToken", 
        "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        LAST);

    web_url("channel.html_3", 
        "URL=https://js.stripe.com/v2/channel.html?stripe_xdm_e=http%3A%2F%2Fhcmorders.online&stripe_xdm_c=default46980&stripe_xdm_p=1", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", 
        "Snapshot=t6.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=https://csi.gstatic.com/csi?v=2&s=mapsapi3&v3v=26.0&action=apiboot2&libraries=places%2Cgeometry%2Cdrawing&e=10_1_0,10_2_0&rt=main.9", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttp%3A%2F%2Fhcmorders.online%2Frestaurants%2Falbies-place%3Faddress_input%3DAdams%2BHall%252C%2BUniversity%2Bof%2BRhode%2BIsland%26restaurant_type%3Ddelivery&4sAIzaSyDoTpY0gsV3nOPP09Syri3ggq0k5xpib0o&callback=_xdc_._i9a8w2&token=33884", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=http://hcmorders.online/restaurants/open_modifier_modal?menu_item_id=1027", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        LAST);

    web_submit_data("add_modifier_to_cart", 
        "Action=http://hcmorders.online/restaurants/add_modifier_to_cart", 
        "Method=POST", 
        "RecContentType=text/javascript", 
        "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", 
        "Snapshot=t7.inf", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=utf8", "Value=✓", ENDITEM, 
        "Name=cookie_key", "Value=", ENDITEM, 
        "Name=menu_item_id", "Value=1027", ENDITEM, 
        "Name=menu_item_price", "Value=8.25", ENDITEM, 
        "Name=all_size_modifier_ids", "Value=", ENDITEM, 
        "Name=price[]", "Value=8.25", ENDITEM, 
        "Name=item_size_id", "Value=699", ENDITEM, 
        "Name=modifier_ids", "Value=", ENDITEM, 
        "Name=order_modifier_ids", "Value=", ENDITEM, 
        "Name=price[]", "Value=9.5", ENDITEM, 
        "Name=modifier_ids", "Value=", ENDITEM, 
        "Name=order_modifier_ids", "Value=", ENDITEM, 
        "Name=mandatory_modifier_ids", "Value=", ENDITEM, 
        "Name=optional_modifier_ids", "Value=", ENDITEM, 
        "Name=instructions_text", "Value=", ENDITEM, 
        "Name=quantity", "Value=1", ENDITEM, 
        LAST);

    web_add_cookie("full_name=mubbashir; DOMAIN=hcmorders.online");

    web_add_cookie("phone_number=333-333-3333; DOMAIN=hcmorders.online");

    web_submit_data("confirm_order", 
        "Action=http://hcmorders.online/restaurants/confirm_order", 
        "Method=POST", 
        "RecContentType=text/javascript", 
        "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", 
        "Snapshot=t8.inf", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=utf8", "Value=✓", ENDITEM, 
        "Name=address_input", "Value=Adams Hall, University of Rhode Island", ENDITEM, 
        "Name=restaurant_type", "Value=delivery", ENDITEM, 
        "Name=restaurant_id", "Value=18", ENDITEM, 
        "Name=from_checkout", "Value=false", ENDITEM, 
        "Name=delivery_charge", "Value=1.50", ENDITEM, 
        "Name=tax", "Value=0.12", ENDITEM, 
        "Name=process_fee", "Value=0.49", ENDITEM, 
        "Name=instructions_text", "Value=", ENDITEM, 
        "Name=all_choice_ids[]", "Value=1027,699", ENDITEM, 
        "Name=sub_total", "Value=8.25", ENDITEM, 
        "Name=discount", "Value=0.00", ENDITEM, 
        "Name=tip", "Value=0.00", ENDITEM, 
        "Name=tax_percent", "Value=8.0", ENDITEM, 
        "Name=delivery_fee", "Value=1.50", ENDITEM, 
        "Name=total", "Value=11.02", ENDITEM, 
        "Name=coupon_code_field", "Value=", ENDITEM, 
        EXTRARES, 
        "Url=../assets/visa.jpg", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/express.jpg", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/mastercard.jpg", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/discover.jpg", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/cash-icon.png", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/loadingg.gif", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../assets/c-card.png", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        "Url=../autocomplete_phone_number?q=333-333-3333", "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery", ENDITEM, 
        LAST);

    web_submit_data("place_order",
        "Action=http://hcmorders.online/orders/place_order",
        "Method=POST",
        "RecContentType=text/html",
        "Referer=http://hcmorders.online/restaurants/albies-place?address_input=Adams+Hall%2C+University+of+Rhode+Island&restaurant_type=delivery",
        "Snapshot=t9.inf",
        "Mode=HTML",
        ITEMDATA,
        "Name=utf8", "Value=✓", ENDITEM,
        "Name=authenticity_token", "Value=jkbx4yBAUdh2ecotpqDRK5F1P2UGyhLedGn9CHJbgWA=", ENDITEM,
        "Name=sub_total", "Value=8.25", ENDITEM,
        "Name=total", "Value=11.02", ENDITEM,
        "Name=all_choice_ids", "Value=1027,699", ENDITEM,
        "Name=restaurant_id", "Value=18", ENDITEM,
        "Name=address_input", "Value=Adams Hall, University of Rhode Island", ENDITEM,
        "Name=restaurant_type", "Value=delivery", ENDITEM,
        "Name=save_order", "Value=", ENDITEM,
        "Name=delivery_charge", "Value=1.50", ENDITEM,
        "Name=tax", "Value=0.78", ENDITEM,
        "Name=process_fee", "Value=0.49", ENDITEM,
        "Name=tip", "Value=0.00", ENDITEM,
        "Name=discount", "Value=0.00", ENDITEM,
        "Name=coupon_code", "Value=", ENDITEM,
        "Name=full_name", "Value=mubbashir", ENDITEM,
        "Name=phone_number", "Value=333-333-3333", ENDITEM,
        "Name=confirm_phone_number", "Value=", ENDITEM,
        "Name=room_no", "Value=", ENDITEM,
        "Name=payment_method", "Value=cash", ENDITEM,
        "Name=credit_card_number", "Value=", ENDITEM,
        "Name=month", "Value=", ENDITEM,
        "Name=year", "Value=", ENDITEM,
        "Name=cvv", "Value=", ENDITEM,
        "Name=tip_percent", "Value=15", ENDITEM,
        "Name=custom_tip_amount", "Value=$", ENDITEM,
        "Name=special_instructions", "Value=", ENDITEM,
        EXTRARES,
        "URL=http://bam.nr-data.net/1/183d9f179e?a=4629762&v=971.ec154e7&to=dVtfR0tXCF1VFB1dRVJRQ0AWTAxQXg1LXUI%3D&rst=1472&ref=http://hcmorders.online/orders/3694/thankyou&ap=20&be=1016&fe=437&dc=423&perf=%7B%22timing%22:%7B%22of%22:1471604397714,%22n%22:0,%22u%22:926,%22r%22:1,%22ue%22:951,%22re%22:643,%22f%22:643,%22dn%22:643,%22dne%22:643,%22c%22:643,%22ce%22:643,%22rq%22:645,%22rp%22:925,%22rpe%22:926,%22dl%22:925,%22di%22:979,%22ds%22:1440,%22de%22:1449,%22dc%22:1449,%22l%22:1454%7D,%22navigation%22:%7B%22rc%22:1%7D%7D&jsonp=NREUM.setToken", "Referer=http://hcmorders.online/orders/3694/thankyou", ENDITEM,
        "URL=https://csi.gstatic.com/csi?v=2&s=mapsapi3&v3v=26.0&action=apiboot2&libraries=places%2Cgeometry%2Cdrawing&e=10_1_0,10_2_0&rt=main.7", "Referer=http://hcmorders.online/orders/3694/thankyou", ENDITEM,
        "URL=https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttp%3A%2F%2Fhcmorders.online%2Forders%2F3694%2Fthankyou&4sAIzaSyDoTpY0gsV3nOPP09Syri3ggq0k5xpib0o&callback=_xdc_._jdtutq&token=130165", "Referer=http://hcmorders.online/orders/3694/thankyou", ENDITEM,
        LAST);

    web_url("channel.html_4", 
        "URL=https://js.stripe.com/v2/channel.html?stripe_xdm_e=http%3A%2F%2Fhcmorders.online&stripe_xdm_c=default368042&stripe_xdm_p=1", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=http://hcmorders.online/orders/3694/thankyou", 
        "Snapshot=t10.inf", 
        "Mode=HTML", 
        LAST);

    return 0;
}

I am getting internal server error at following statement:

 web_submit_data("place_order",

Following is snippet from output window:

Action.c(199): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://hcmorders.online/orders/place_order"      [MsgId: MERR-26612]
Action.c(199): Warning -26200: At least one of the resources specified by EXTRARES has not been downloaded due to the above error(s)    [MsgId: MWAR-26200

I've manually correlated the first occurrence of the dynamic value and verified it in the snapshot view that it is fine.

1
  • Well, you found a bug :)
    – dzieciou
    Commented Jan 6, 2017 at 20:31

4 Answers 4

1

Notice, you are violating a lot of testing 101 here. For each step there is an expected result. You are not checking in your test code for the positive, expected step result. Along with that lack of checking, there is no branching of execution when the positive expected result is not achieved. As a result your business process has likely come off the rails, at least one to two steps before your HTTP 500 where it is returning a valid "HTTP 200" page, but the page content is not appropriate to successful execution of the business process.

I also see unhandled dynamic items, things that you would never type in or pick off the screen, yet are held static in your test code. You need to handle those items.

0

For status code 500's I usually look to get from information from the application and or server logs to give more than 'snippet from output window'.

0

500 Internal Server in the context of LoadRunner, usually means that the request was not constructed properly.

Towards this, you can compare the request headers of the 'Recording' and 'Replay'. Check to see if there are any missing headers and add them using "web_add_header" function.

The error could also be due to incorrect data being sent as part of the request body.

In your case,

"Name=authenticity_token", "Value=jkbx4yBAUdh2ecotpqDRK5F1P2UGyhLedGn9CHJbgWA="

probably requires correlation, as is seems to authenticate the current request session.

In general, understand the error message from the snapshot of the request and try solving the issue.

0

Try using the TruClient protocol in Vugen for Loadrunner, that works on the GUI level of the website. You don't have to do any correlation yourself, just do actions en checks.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.