Sorry, I have no background with squirelmail so when you say 'squirrelmail creates the file' I have no idea if you are talking about the client.. the server.. and what interactions are happening. Does it do a post.. get a response.. and post again with the file contents, etc. I have no idea. It doesn't make sense to me why there is any file creation when I am uploading an attachment except to store the file on the server.. which the client never sees except when browsing the page. Its not clear from your test description what you are actually trying to test. Viewing the message after its been sent? Retrieving a message with an attachment? I don't know.
Simulating this is heavily dependent on where work is done. If the task requires lots of client side scripting to actually do work on the page, and not just display stuff.. it will be hard to do with jmeter easily unless you reproduce all the script work the browser normally does. Maybe an example will help you understand the high level. Assume the task is to upload a picture to a page, and when the upload is done, the page displays a link to the new image. We assume the response includes the webpage displayed after your upload. Your test is you want to upload the image, then retrieve the new link to the image presented by the server so you can test it actually works without error. If the posting of the image is with a static form you can reliably predict the parameters that must be posted.. you can do it pretty simply. | http sampler w/parameters - to post the file to the website's form | reg ex extractor extracting the new image's URL to a variable - use regex to extract from the page the link to the new page you are going to verify | http sampler using variable from regex - retrieve the page you want to verify | response assertion to check for errors You can't just rely on the recorded script to do everything for you when dealing with dynamic content.. you need to interpret how the page interacts with the client and use the recorded script as a starting point. You need to understand where values are coming from.. user supplied.. script.. server response, etc. In the above example.. if you used the proxy recorder and replayed it. It would probably fail in the second http sampler because the URL or parameters to use would simply be the ones you recorded the first time.. which may no longer be valid.. rather then based on the server response in front of it So you must update the recorded script to retrieve the URL or parameters to use and update the sampler with the correct variables replacing the static strings. You must do the work to replace recorded static values with dynamic content by knowing where the content is coming from.. getting it.. and updating your samplers accordingly with the new values. The proxy recorder only records event sequences passed back and forth between the browser and server. It does not create the elements needed to handle dynamic content such variables based on server responses. That you need to add after. -----Original Message----- From: Jmeter_User [mailto:[email protected]] Sent: Thursday, January 22, 2009 9:51 AM To: [email protected] Subject: RE: Squirrelmail attachment error when combined with jmeter to send attachments multiple times Hi Steve, Thanks for the reply. May be I was not more clear. I am new to jmeter and trying to solve this problem. Here I am using jmeter to record squirrelmail client. The problem what I am facing, is to do with the randomly created file name on the fly by squirrelmail when attaching the file. here I am just re running the script which I had recorded with attaching one file. When I re run, it will attach the same file, but due to the way squirrelmail behaviour, it will again create the randomly new file (32 characters) and try to send it. I am not able to capture the newly created file on the fly, because the .jmx file is not having this info stored anywhere. First time it creates the file 1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA and when re run it created the name 0VIpOBdvcpYkGqCtd2Lvhs8B0o7HfW8A. All these are created on the fly by squirrelmail. Hope now you are able to understand the problem. Do let me know please how to extract using post processor because its not clearly visible in jmx. Really Appreciate your help. Steve Kapinos wrote: > > Not familiar with the interaction of squirrelmail.. or how you are doing > your test (why would the client know or have access to the server's > filesystem at all?) but if the server is generating some value you wish > to use again.. the general theory is you must extract the server generated > value from the response message and feed that into your later samples. > > Presumably you are posting something with the file... which the server > returns a response. Then you must use a post-processing element to > extract the value you need (like a regex extractor) and then put that > value into your next sample. > > Unfortunately your description doesn't help explain the client/server > interaction you are doing - so can't be more descriptive then that. > > -----Original Message----- > From: Jmeter_User [mailto:[email protected]] > Sent: Thursday, January 22, 2009 9:10 AM > To: [email protected] > Subject: Squirrelmail attachment error when combined with jmeter to send > attachments multiple times > > > Apologies for the lengthy mail. I am trying to explain the problem in > detail. > I need help badly to solve the below problem. Any suggestion is > appreciated. > > We are recording the scenario of sending a mail with attachment through > Squirrel mail Using Jmeter. Our intension is to send many mails using > Jmeter > and Squirrelmail. > > While recording, > I attached the file and sent. It got recorded successfully. But when I > start running the script using jmeter, I am getting error because the file > name is hard coded in script and its not able to find the same name again. > The file name will be created on the fly in squirrelmail and will be > stored > for the section “attach file” . The sample attach file is below. > > a:1:{i:0;O:7:"Message":21:{s:13:"rfc822_header";s:0:"";s:19:"reply_rfc822_header";s:0:"";s:11:"mime_header";O:13:"MessageHeader":10:{s:5:"type0";s:11:"application";s:5:"type1";s:12:"octet-stream";s:10:"parameters";a:1:{s:4:"name";s:10:"jmeter.log";}s:2:"id";i:0;s:11:"description";s:0:"";s:8:"encoding";s:0:"";s:4:"size";i:0;s:3:"md5";s:0:"";s:11:"disposition";O:11:"Disposition":2:{s:4:"name";s:10:"attachment";s:10:"properties";a:1:{s:8:"filename";s:10:"jmeter.log";}}s:8:"language";s:0:"";}s:5:"flags";s:0:"";s:5:"type0";s:0:"";s:5:"type1";s:0:"";s:8:"entities";a:0:{}s:9:"entity_id";s:0:"";s:10:"parent_ent";N;s:6:"entity";N;s:6:"parent";s:0:"";s:12:"decoded_body";s:0:"";s:7:"is_seen";i:0;s:11:"is_answered";i:0;s:10:"is_deleted";i:0;s:10:"is_flagged";i:0;s:10:"is_mdnsent";i:0;s:9:"body_part";s:0:"";s:6:"offset";i:0;s:6:"length";i:0;s:14:"att_local_name";s:32:"1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA";}} > > What squirrelmail basically does is, it copies the attached file and store > it in its configured attachment directory. The name of the file stored in > attachment directory wont be same as file name. It stores the file name in > 32 characters. For eg: 1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA, which is given > above as part of the attach file. > > The files listed in attachment directory are > ### ls -l > rw------- 1 _www staff 13970 Jan 22 04:47 > 0VIpOBdvcpYkGqCtd2Lvhs8B0o7HfW8A > -rw------- 1 _www staff 5853 Jan 22 04:12 > BoALKfX8ENj1bXBZYUIoxRMO06tOgAKz > -rw------- 1 _www staff 18860 Jan 22 05:24 > LC6BvjJzlfVJKojTcNIiVO3TX6LRQ0Lz > -rw------- 1 _www staff 10058 Jan 22 04:38 > LZ44HTqSqju1VSEpbTTc21VOSW0dnLs2 > > So when I start running, basically the script will attach again the same > file, but it will store in squirrelmail attach directory with on the fly > created file name (some 32 characters file name), which is not known to > the > script, as it is created on the fly. And the script fails because it tries > to open the file which is hard coded in the script. I get the below error: > >> Warning: >> fopen(/Library/WebServer/Documents/squirrelmail/attach/1ajDgYkgMQoKBVkC2xkTbUF5yScvcHlA) >> [function.fopen]: failed to open stream: No such file or directory in >> /Library/WebServer/Documents/squirrelmail/class/deliver/Deliver.class.php >> on line 307 > > It wont find the above file because it will be deleted from attachment > directory once its sent successfully. > > I presume I need to do some kind of correlation for attach file section. > So > that jmeter will pick the newly created file and attach it. > I need help in correlating it so that, if I run the script multiple times, > jmeter and squirrelmail should be able to send each time, the same file > again and again. How can I do that? > > I tried modifying the attach file for that 32 characters and replaced with > regular expression “(.+?)”. But I am getting the below error: > > Notice: unserialize() [function.unserialize]: Error at offset 866 of > 876 > bytes in /Library/WebServer/Documents/squirrelmail/src/compose.php on > line 370 > > > Appreciate help in solving the above problem. Thanks in advance. > -- > View this message in context: > http://www.nabble.com/Squirrelmail-attachment-error-when-combined-with-jmeter-to-send-attachments-multiple-times-tp21604839p21604839.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://www.nabble.com/Squirrelmail-attachment-error-when-combined-with-jmeter-to-send-attachments-multiple-times-tp21604839p21605616.html Sent from the JMeter - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

