I am trying to upload tar.gz files into google cloud bucket using jmeter. Here i am using File management service, GCS & Jmeter.
Execution flow.
1. Using get Request i am hitting FMS.In response I'll get response message. this response contains the URL to upload the file to GCS.
2. Now the file SJ311.tar.gz file is uploaded in the folder iviu/SJ311 folder in GCS.
3. In GCS cloud function is written a code which will extract the .gz file & all .csv files should be extracted successfully.
Issue : through POSTMAN i am able to do this i.e. file is uploaded & it is decompressing the tar file but using jmeter file is uploaded successfully but its not extracting/decompressing.
If you're able to send the request using Postman and see that JMeter behaves differently than it means that you're not sending the same request using JMeter.
Most probably this is due to missing or incorrectly defined HTTP Header so make sure to compare each and every detail of the request and given you send the same requests you should get the same behaviour/response.
Going forward if something is working in Postman and not working in JMeter you can just record the relevant request using JMeter's HTTP(S) Test Script Recorder, just configure Postman to use JMeter as the proxy and run your request, JMeter will capture it and properly build the HTTP Request sampler, add HTTP Header Manager, etc.
Just remember to copy the file(s) you will be uploading to the "bin" folder of your JMeter installation prior to recording, otherwise JMeter will not be able to capture the request.
Solution to the above question is, under File upload section-> under Parameter name field i added DOM attribute or webelement value for the "upload file" button which is present in Google cloud storage screen.
Now after removing that parameter value, file is getting uploaded successfully.
If we add the attribute value, file will get uploaded successfully but it will be corrupted.
Please find the below post data for the request to send the file to application,I have tried but not uploading the file to application and even I couldn't see any error for that request in jmeter,Please hel me.
{"requests":[{"event":[{"controller_id":"${codDocID}","event":"AddFileMDSubmit","id":"createFile","param":[{"name":"Path","value":"/Root/AttachmentFolder"},{"name":"Action","value":"CreateFile"}]}],"data":[{"scope":[{"path":"/Root","changed":""},{"path":"/Root/EnableDisableActionMenu","changed":""},{"path":"/Root/$System","changed":""},{"path":"/Root/$ThingHeader","changed":""},{"path":"/Root/UIState","changed":""},{"path":"/Root/ZSchdleDateTime_200486e20a2d29145d81bba1f204e795","changed":""},{"path":"/Root/zFeederRelevant","changed":""},{"path":"/Root/$UISwitch","changed":""},{"path":"/Root/ToCoreBO","changed":""},{"path":"/Root/LaunchPreviewPDFStruct","changed":""},{"path":"/Root/ScopingIndicator","changed":""},{"path":"/Root/HybrisIntegration","changed":""},{"path":"/Root/UtilitiesIndExt","changed":""},{"path":"/Root/TP_ResolutionDueDateTime/content","changed":""},{"path":"/Root/TP_ResolutionDueDateTime","changed":""},{"path":"/Root/TP_CompletionDue/content","changed":""},{"path":"/Root/TP_CompletionDue","changed":""},{"path":"/Root/ExternalSalesOrderDocumentReference","changed":""},{"path":"/Root/EmailFeeder/InteractionAttachments","changed":"","columns":[{"path":"SelectedIndicator","changed":"X"},{"path":"NodeID","changed":"X"}]},{"path":"/Root/Customer_BusinessPartner/Structure","changed":""},{"path":"/Root/Customer_BusinessPartner","changed":""},{"path":"/Root/PricingTerms","changed":""},{"path":"/Root/CpTotalCustAmount_0479727343a243b5b39e3b8dd38054aa","changed":""},{"path":"/Root/CpTotalReclAmount_bff3d7be2aec457786179c6bc6f0e83b","changed":""},{"path":"/Root/CpTotalReclUponRet_55e401c0e848418fb07a3b71c480125e","changed":""},{"path":"/Root/CpTotalCustInDest_ebcecb07263e4d81b8ad6a2105b4ce16","changed":""},{"path":"/Root/CpTotalReclInDest_73eb1b917ee34f2db12f1d491d0e642e","changed":""},{"path":"/Root/CpTotalCustUponRet_4d69521c51ac4e7b96601ad2402a599e","changed":""},{"path":"/Root/ZK_ApprovedAmount_75f8a8768f4708ab080050e720617a13","changed":""},{"path":"/Root/CreatedOn","changed":""},{"path":"/Root/ChangedOn","changed":""},{"path":"/Root/TP_InitialReceipt/content","changed":""},{"path":"/Root/TP_InitialReceipt","changed":""},{"path":"/Root/TP_InitialResponseDue/content","changed":""},{"path":"/Root/TP_InitialResponseDue","changed":""},{"path":"/Root/TP_InitialResponse/content","changed":""},{"path":"/Root/TP_InitialResponse","changed":""},{"path":"/Root/TP_Completion/content","changed":""},{"path":"/Root/TP_Completion","changed":""},{"path":"/Root/TP_ResponseByProcessorDue/content","changed":""},{"path":"/Root/TP_ResponseByProcessorDue","changed":""},{"path":"/Root/CpApprovalAchievedDateTime_e5a9db72014e12473aa7b19f1b100ecc","changed":""},{"path":"/Root/SearchResults","changed":"","columns":[{"path":"Index","changed":"X"},{"path":"ArticleIcon","changed":"X"},{"path":"ExternalKnowledgeBaseArticleURI","changed":"X"},{"path":"ExternalKnowledgeBaseCode","changed":"X"},{"path":"ExternalKnowledgeBaseArticleID","changed":"X"},{"path":"Author","changed":"X"},{"path":"Date","changed":"X"},{"path":"ExternalKnowledgeBaseArticleDescription","changed":"X"},{"path":"ExternalKnowledgeBaseArticleDescription1","changed":"X"},{"path":"ExternalKnowledgeBaseArticleShortURI","changed":"X"},{"path":"ExternalKnowledgeBaseArticleURI1","changed":"X"},{"path":"JAMUri","changed":"X"},{"path":"JAMViewsCount","changed":"X"},{"path":"NodeID","changed":"X"},{"path":"Note","changed":"X"}]},{"path":"/Root/From_KB_EC/DetailView","changed":""},{"path":"/Root/From_KB_EC","changed":""},{"path":"/Root/SimilarTickets","changed":"","columns":[{"path":"Index","changed":"X"},{"path":"Name","changed":"X"},{"path":"ID","changed":"X"},{"path":"UUID","changed":"X"},{"path":"#RowCount","changed":"X"},{"path":"CustomerFormattedName","changed":"X"},{"path":"ReporterName","changed":"X"},{"path":"ServiceRequestUserLifeCycleStatusCode","changed":"X"},{"path":"CreationDateTime","changed":"X"},{"path":"ProductID","changed":"X"}]},{"path":"/Root/SimilarTicket_UIData","changed":""},{"path":"/Root/TimeEntry_MergeTimeItem","changed":""},{"path":"/Root/ChildServiceRequstModificationUserSelected","changed":""},{"path":"/Root/TP_ResolvedOnDateTime","changed":""},{"path":"/Root/TP_OnSiteArrivalDateTime","changed":""},{"path":"/Root/TP_OnSiteArrivalDueDateTime","changed":""},{"path":"/Root/TP_RequestedFulfillmentEndDateTime","changed":""},{"path":"/Root/TP_RequestedFulfillmentStartDateTime","changed":""},{"path":"/Root/TP_Escalation","changed":""},{"path":"/Root/TP_ResponseByCustomer","changed":""},{"path":"/Root/TP_ResponseByProcessor","changed":""},{"path":"/Root/WarrantyReferenceDateTime","changed":""},{"path":"/Root/StickyNoteInteractor","changed":""},{"path":"/Root/PricingTerms/DateTime","changed":""},{"path":"/Root/Groups_Recommended","changed":""},{"path":"/Root/LoggedUserDetails","changed":""},{"path":"/Root/zAWS_Features","changed":""}],"id":"${codSeodAgentID}"},{"id":"${codDocID}","flat_data":[{"key_path":"/Root/AttachmentFolder/AddParams/TypeCode","value":"${typeCodeVal}","aspect":"C"},{"key_path":"/Root/AttachmentFolder/OutputRelevant","value":"","aspect":"C"},{"key_path":"/Root/AttachmentFolder/AddParams/fileName","value":"${fileName}","aspect":"C"},{"key_path":"/Root/AttachmentFolder/AddParams/Title","value":"${fileName}","aspect":"C"},{"key_path":"/Root/AttachmentFolder/AddParams/fileSize","value":"190","aspect":"C"},{"key_path":"/Root/AttachmentFolder/AddParams/content","value":"id%3D00163E2F045E1EE88BD561E26708DE0E","aspect":"C"}]}]}]}
Store your file in "bin" folder of your JMeter installation as i.e. data.json
Switch to "File Upload" tab of the HTTP Request sampler and configure it like:
If you're uncertain regarding what to put in the "Parameter Name" field you can just record your request using JMeter's HTTP(S) Test Script Recorder via web browser, just make sure that the data.json file is present in JMeter's "bin" folder. Check out Recording File Uploads with JMeter guide for more details.