Uploading is failing when I tried with LR script (41 Views)
Reply
Occasional Contributor
SPyneni
Posts: 6
Registered: ‎04-09-2010
Message 1 of 2 (41 Views)

Uploading is failing when I tried with LR script

Below is the web custom request that is generated when I recorded a script while uploading a file.

I am unable to fetch the hash value in the web_submit_data.

Secondly, what changes to be done in web_custom_request for successfully uploading. The content of the text file starts after binary\r\n\r\n in body field.

Pls help me in resolving this at the earliest.


web_submit_data("hash",
"Action={Server}/sap({ACTID})/bc/gui/sap/its/webgui/~{ACTID_2}/1.102/data/hash?Hash=khrxtxsdiqxmrrpkoifpfquogmqmgssg",
"Method=POST",
"TargetFrame=",
"RecContentType=application/x-unknown",
"Referer=",
"Snapshot=t13.inf",
"Mode=HTML",
ITEMDATA,
LAST);

web_custom_request("post",
"URL={Server}/sap({ACTID})/bc/gui/sap/its/webgui/~{ACTID_2}/1.102/data/post",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=application/x-unknown",
"Referer=",
"Mode=HTML",
"EncType=multipart/form-data; boundary=93D80B64063411d4B4C2006094B98F91",
"Body=--93D80B64063411d4B4C2006094B98F91\r\nContent-Disposition: form-data; name=\"LOCALFILE1\"; filename=\"Dummy\"\r\nContent-Type: application/x-unknown\r\nContent-Transfer-Encoding: binary\r\n\r\nDRS\tEPA\t1900210072\t1115511182\tV\tUSD\t-1305\r\nDRS\tSEA\t1900210073\t1115511183\tV\tUSD\t-1306\r\nDRS\tEBR\t1900210074\t1115511184\tV\tUSD\t-1307\r\nDRS\tEMC\t1900210075\t1115511185\tV\tUSD\t-1308\r\nDRS\tEHK\t1900210076\t1115511186\tV\tUSD\t-1309\r\n--93D80B64063411d4B4C2006094B98F91",
LAST);
Please use plain text.
Advisor
Raymond Lorenz
Posts: 20
Registered: ‎08-14-2010
Message 2 of 2 (41 Views)

Re: Uploading is failing when I tried with LR script

so the hash value is generated by the client side processing? or by the server in a previous steps response. The web_reg_parm needs to before the step that sends the hash. Typically the step before this one. Client side needs a custom script solution.

If the uploaded bin part stays the same you can leave like it is. (small file above). (boundary might need be dynamic.)
If it doesn't and the above is the standard body length you could stick it in a parm file. like "binary\r\n\r\n{p_BODY}--93D80B64063411d4B4C2006094B98F91", "
and the csv file would have the rest. (fyi Boundary might need to be dynamic parm too.) The above just looks like a tab deliminated file. You then can parameterize just the sections needed. Or build the string using C commands from previous web pages.

If they are large files and you have a large set of files. You could either convert them to all text before hand. Then you need to be sure they are included on the files the LR copies to each generator as well as the method to select the right files.

Or if the file is sent from the server to client in the steps before you need a large dynamic parm to hold it until needed.

Typically for performance testing only the size matters as the server is just storing for future use. If it isn't lots of custom script work.
"Although I am an HP employee, I am speaking for myself and not for HP"
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation