Search the web
Sign In
New User? Sign Up
Advanced-LoadRunner
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Parameterizing uploaded files   Message List  
Reply | Forward Message #1078 of 1092 |
I am unclear on what happens under the covers when a file is uploaded to
a web site. From the Generation Log file, it appears that LoadRunner
reads the file(s) at run time, packages them together, and sends them to
the server as an attachment to a single POST request. Is that right?



My issue is that I need to parameterize some values in the files that
get uploaded. Any idea of how to do that? I could create a large
number of unique files then parameterize the file name in the
web_submit_data, but that is a pain.



Better still, would be if there is a way simply generate a string in
memory them pass it to the POST so that it looks like it is attached as
a multipart/form-data.



This is my captured/modified web_submit_data statement.



web_submit_data("File Uploader",

"Action=http://xyz.com",

"Method=POST",

"EncType=multipart/form-data",

"RecContentType=text/html",

"Mode=HTML",

ITEMDATA,

"Name=file0", "Value=C:\\temp\\CustomerOrder.dat", "File=Yes",
ENDITEM,

"Name=file1", "Value=", "File=Yes", ENDITEM,

"Name=file2", "Value=", "File=Yes", ENDITEM,

"Name=file3", "Value=", "File=Yes", ENDITEM,

LAST);





[Non-text portions of this message have been removed]




Tue Aug 5, 2008 7:58 pm

msm_portata
Offline Offline
Send Email Send Email

Forward
Message #1078 of 1092 |
Expand Messages Author Sort by Date

I am unclear on what happens under the covers when a file is uploaded to a web site. From the Generation Log file, it appears that LoadRunner reads the file(s)...
msm@...
msm_portata
Offline Send Email
Aug 5, 2008
7:51 pm

... One way would be to use C file handling functions to open and modify the file with the parameters before uploading it. But depending on how much you need...
Gaurav Gupta
guitarist_in
Offline Send Email
Aug 7, 2008
10:04 pm

Hi Gaurav,   Thank you for your good suggestions.   I hate to admit it, but I got it working in JMeter then used Vugen to record a JMeter execution...
msm@...
msm_portata
Offline Send Email
Aug 7, 2008
10:47 pm

Interesting. I'll have to try that too. By correct attribute settings, do you mean the file contents in the body of the request? If possible, can you post a...
Gaurav Gupta
guitarist_in
Offline Send Email
Aug 8, 2008
6:27 pm

This is the code web_custom_request("newOrder", "URL=http://xyz.com/.../", "Method=POST", "Resource=0", "RecContentType=application/xml", "Referer=", ...
msm@...
msm_portata
Offline Send Email
Aug 8, 2008
6:31 pm

In the unlikely case that anybody's still interested, I was able to create a custom web_custom_request for file uploads. I wrote about it here: ...
Gaurav Gupta
guitarist_in
Offline Send Email
Oct 9, 2008
2:40 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help