0

I am trying to login to an application and it has text/html and some application/json. I am able to login to the application from the previous request but I believe the json is loading some additional data and it is giving me a 404 error. I tried adding the headers as shown below but still no luck. I have attached a snapshot to show the different request headers that are being loaded.

Also, I am not able to correlate cflags, umps session ID as I am not sure where they coming from. I don't see in the server response. Just the headers. Can anyone give me some info here please?

Please let me know if I am missing something.

[//Key  Value Accept    text/javascript, text/html, application/xml, application/json, text/xml, */*
    web_add_header("Accept", "text/javascript, text/html, application/xml, application/json, text/xml, */*");
//Key   Value X-Requested-With  XMLHttpRequest
    web_add_header("X-Requested-With", "XMLHttpRequest");
//Key   Value Content-Type  application/x-www-form-urlencoded
    web_add_header("Content-Type", "application/x-www-form-urlencoded");
//Key   Value Host  0.umps40-c2-was.salesforce.com
    web_add_header("Host", "0.umps40-c2-was.salesforce.com");   
    web_add_header("umpsSessionId", "dummy");
    web_add_header("chanelId", "dummy");
    web_add_header("objectId", "dummy");
    web_add_header("orgID", "dummy");
    web_add_header("sessionId", "dummy");
    web_add_header("Cookie", "BrowserId={BrowserId_1}");
//Key   Value umpsSessionId f4ba5dacfe5785ca04b3372b50d8ea179d4d1e72
//Key   Value User-Agent    Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    web_add_header("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko");
//Key   Value connectUrl    https://na30.salesforce.com
    web_add_header("connectUrl", "https://na30.salesforce.com");
//Key   Value Request   PUT /api/channel/v28.0/common/sessions/this?cflag=1454473295572 HTTP/1.1
    web_add_header("Request", "PUT /api/channel/v28.0/common/sessions/this?cflag=1454473295572 HTTP/1.1");

    web_submit_data("sessions",
        "Action=https://1.umps40-c2-was.salesforce.com/api/presence/v28.0/common/sessions?cflag=1454434577950", 
        "Method=POST", 
        "TargetFrame=", 
        "RecContentType=application/json", 
        "Referer=https://1.umps40-c2-was.salesforce.com/umps/UMPSWidget_184/_js.html?cflag=184.36&order=2&parentUrl=https://na30.salesforce.com&connectUrl=https://na30.salesforce.com", 
        "Snapshot=t14.inf", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=data", "Value={}", ENDITEM, 
        LAST);][1]
  • LoadRunner Training? Assigned Mentor? Just trying to understand your level of skills and support before responding – James Pulley Feb 03 '16 at 18:10
  • Thanks for the response James. I have done some training on Loadrunner and have a good understanding of the concepts. I am proficient in correlating using web reg save param and regexp as well. Used different attributes that come with web reg save param. I worked on applications which have json requests and last time I was having a 404 error. I checked the developer tools and added some headers which helped me solve the issue. However, I don't have a mentor that could assist me now. Any help would be appreciated! – Vivek Feb 03 '16 at 18:27
  • 1
    Hi Vivek, don't waste your time recording this multiple times, you are then too reliant on what LoadRunner picks up, and its hit and miss with XHR requests. Use Chrome Dev Tools, Firebug, Fiddler, HTTP Watch, etc and look at the request from the actual browser. I would suggest that its probably the fact that you are using a POST when the web_add_header lists a PUT. – Joel Deutscher Feb 03 '16 at 23:24
  • Joel, Thanks for your inputs. I have actually attached a snapshot of the request headers earlier but I don't see it now. However, you are right! the request that has been failing is a PUT and I changed the "Method=PUT", but that did not help as well. Also, I added a header as below but the cflag keeps changing and I am not finding a way to capture that. Is it possible that it is generated on the client side and hence I don't see that in the server response. Do you know a solution to that? web_add_header("Request", "PUT /api/channel/v28.0/common/sessions/this?cflag=1454473295572 HTTP/1.1"); – Vivek Feb 04 '16 at 01:53
  • There are actually 3 cflags for 3 different requests and I was able to capture 2 of them but unable to capture the 3rd one. Still looking into it!! – Vivek Feb 04 '16 at 02:17

1 Answers1

0

Record Twice, with all headers. Compare the test code generated. This will be very verbose and differences should show up between the two which are related to the dynamic elements, even in the headers.

Dynamic data has many sources, not all of which are server bound. Session will always have a server component. Look for the value in the generation log. Other items which apparently have no server source then you will likely find are being generated at the client based upon date, time or a transformation of data previously sent from the server.

James Pulley
  • 5,606
  • 1
  • 14
  • 14