{"id":556,"date":"2019-12-04T17:44:36","date_gmt":"2019-12-04T12:14:36","guid":{"rendered":"http:\/\/http:\/\/artoftesting.com\/\/?p=556"},"modified":"2020-01-07T14:47:24","modified_gmt":"2020-01-07T09:17:24","slug":"fileuploadinjmeter","status":"publish","type":"post","link":"https:\/\/artoftesting.com\/fileuploadinjmeter","title":{"rendered":"File Upload in JMeter"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Handling File Upload in JMeter<\/h3>\n\n\n\n<p>Quite often we are required to script scenarios where uploading files to server functionality is required to be load tested. In this tutorial, we will see how to handle file upload in JMeter.<br><br>Configure the HTTP Request Sampler with the following detail in order to perform the file upload action-<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Server Name and Path parameters will be name of the server and its Path<\/li><li>File upload in JMeter will be a HTTP Post request. So, we would be required to select&nbsp;<strong>POST<\/strong>&nbsp;Method in&nbsp;<strong>HTTP Request<\/strong>&nbsp;sampler.<\/li><li>Uploading file to server requires building a multipart\/form-data request. For this we will check&nbsp;<strong>multipart\/form-data for POST<\/strong>&nbsp;checkbox in HTTP Request sampler.<img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"421\" class=\"wp-image-557\" style=\"width: 600px;\" src=\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-1.jpg\" alt=\"File Upload in Jmeter\" srcset=\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-1.jpg 641w, https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-1-300x211.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br><br><\/li><\/ul>\n\n\n\n<p>Next, we are required to click on the Add button on the&nbsp;<strong>Send File With Request<\/strong>&nbsp;section. Fill the textbox under &#8220;Send File With Request&#8221; with the following data-<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>File Path : Path of the file to be uploaded (local directory)<\/li><li>Parameter Name : The parameter name is the value of the &#8220;name&#8221; attribute of the file type tag(upload button) e.g. in case of file upload in tinypic.com, the value of &#8220;Parameter Name&#8221; will be &#8220;the_file&#8221;. Refer to image below for reference &#8211; just inspect element(F12) on the upload button and fetch the value of name attribute.<\/li><li>Mime Type : This determines the type of file to be uploaded e.g. for text file the value of Mime Type will be &#8220;text\/plain&#8221;, for image &#8220;image\/jpeg&#8221; etc.<img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"453\" class=\"wp-image-558\" style=\"width: 600px;\" src=\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-2.jpg\" alt=\"File Upload in jmeter\" srcset=\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-2.jpg 601w, https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/file-upload-in-jmeter-2-300x227.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/li><\/ul>\n\n\n\n<p>This concludes the file upload handling in the JMeter tutorial. <em>please comment below if you have any queries. Check out the complete JMeter tutorial below.<\/em>  <br><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><a href=\"http:\/\/artoftesting.com\/jmeter-tutorial\">JMeter Tutorial<\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Handling File Upload in JMeter Quite often we are required to script scenarios where uploading files to server functionality is required to be load tested. In this tutorial, we will see how to handle file upload in JMeter. Configure the HTTP Request Sampler with the following detail in order to perform the file upload action- &#8230; <a title=\"File Upload in JMeter\" class=\"read-more\" href=\"https:\/\/artoftesting.com\/fileuploadinjmeter\" aria-label=\"Read more about File Upload in JMeter\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1584,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jmeter"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JMeter File Upload<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and &#039;Use multipart\/form-data for POST&#039; option.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/artoftesting.com\/fileuploadinjmeter\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JMeter File Upload\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and &#039;Use multipart\/form-data for POST&#039; option.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/artoftesting.com\/fileuploadinjmeter\" \/>\n<meta property=\"og:site_name\" content=\"ArtOfTesting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/artoftesting\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-04T12:14:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-07T09:17:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kuldeep Rana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:site\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kuldeep Rana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#article\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter\"},\"author\":{\"name\":\"Kuldeep Rana\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\"},\"headline\":\"File Upload in JMeter\",\"datePublished\":\"2019-12-04T12:14:36+00:00\",\"dateModified\":\"2020-01-07T09:17:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter\"},\"wordCount\":285,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg\",\"articleSection\":[\"JMeter\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/artoftesting.com\/fileuploadinjmeter#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter\",\"url\":\"https:\/\/artoftesting.com\/fileuploadinjmeter\",\"name\":\"JMeter File Upload\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg\",\"datePublished\":\"2019-12-04T12:14:36+00:00\",\"dateModified\":\"2020-01-07T09:17:24+00:00\",\"description\":\"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and 'Use multipart\/form-data for POST' option.\",\"breadcrumb\":{\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/artoftesting.com\/fileuploadinjmeter\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage\",\"url\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg\",\"contentUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg\",\"width\":700,\"height\":400,\"caption\":\"handling file upload in jmeter\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/artoftesting.com\/fileuploadinjmeter#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/artoftesting.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Performance Testing\",\"item\":\"https:\/\/artoftesting.com\/category\/performance-testing\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JMeter\",\"item\":\"https:\/\/artoftesting.com\/category\/performance-testing\/jmeter\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"File Upload in JMeter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/artoftesting.com\/#website\",\"url\":\"https:\/\/artoftesting.com\/\",\"name\":\"ArtOfTesting\",\"description\":\"A Beginners Guide to Testing\",\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/artoftesting.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/artoftesting.com\/#organization\",\"name\":\"ArtOfTesting\",\"url\":\"https:\/\/artoftesting.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"contentUrl\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"width\":400,\"height\":60,\"caption\":\"ArtOfTesting\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/artoftesting\",\"https:\/\/x.com\/theartoftesting\",\"https:\/\/www.linkedin.com\/groups\/4797819\/\",\"https:\/\/in.pinterest.com\/artoftesting\/\",\"https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\",\"name\":\"Kuldeep Rana\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"caption\":\"Kuldeep Rana\"},\"description\":\"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JMeter File Upload","description":"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and 'Use multipart\/form-data for POST' option.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/artoftesting.com\/fileuploadinjmeter","og_locale":"en_US","og_type":"article","og_title":"JMeter File Upload","og_description":"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and 'Use multipart\/form-data for POST' option.","og_url":"https:\/\/artoftesting.com\/fileuploadinjmeter","og_site_name":"ArtOfTesting","article_publisher":"https:\/\/facebook.com\/artoftesting","article_published_time":"2019-12-04T12:14:36+00:00","article_modified_time":"2020-01-07T09:17:24+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg","type":"image\/jpeg"}],"author":"Kuldeep Rana","twitter_card":"summary_large_image","twitter_creator":"@theartoftesting","twitter_site":"@theartoftesting","twitter_misc":{"Written by":"Kuldeep Rana","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#article","isPartOf":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter"},"author":{"name":"Kuldeep Rana","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5"},"headline":"File Upload in JMeter","datePublished":"2019-12-04T12:14:36+00:00","dateModified":"2020-01-07T09:17:24+00:00","mainEntityOfPage":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter"},"wordCount":285,"commentCount":1,"publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"image":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg","articleSection":["JMeter"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/artoftesting.com\/fileuploadinjmeter#respond"]}]},{"@type":"WebPage","@id":"https:\/\/artoftesting.com\/fileuploadinjmeter","url":"https:\/\/artoftesting.com\/fileuploadinjmeter","name":"JMeter File Upload","isPartOf":{"@id":"https:\/\/artoftesting.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage"},"image":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg","datePublished":"2019-12-04T12:14:36+00:00","dateModified":"2020-01-07T09:17:24+00:00","description":"In this tutorial, we will learn the scripting of file upload scenario in JMeter. Handling file upload scenario in JMeter make use of HTTP Request Sampler with Post method and 'Use multipart\/form-data for POST' option.","breadcrumb":{"@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/artoftesting.com\/fileuploadinjmeter"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#primaryimage","url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg","contentUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Handling-File-Upload-in-JMeter.jpg","width":700,"height":400,"caption":"handling file upload in jmeter"},{"@type":"BreadcrumbList","@id":"https:\/\/artoftesting.com\/fileuploadinjmeter#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/artoftesting.com\/"},{"@type":"ListItem","position":2,"name":"Performance Testing","item":"https:\/\/artoftesting.com\/category\/performance-testing"},{"@type":"ListItem","position":3,"name":"JMeter","item":"https:\/\/artoftesting.com\/category\/performance-testing\/jmeter"},{"@type":"ListItem","position":4,"name":"File Upload in JMeter"}]},{"@type":"WebSite","@id":"https:\/\/artoftesting.com\/#website","url":"https:\/\/artoftesting.com\/","name":"ArtOfTesting","description":"A Beginners Guide to Testing","publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/artoftesting.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/artoftesting.com\/#organization","name":"ArtOfTesting","url":"https:\/\/artoftesting.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/","url":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","contentUrl":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","width":400,"height":60,"caption":"ArtOfTesting"},"image":{"@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/artoftesting","https:\/\/x.com\/theartoftesting","https:\/\/www.linkedin.com\/groups\/4797819\/","https:\/\/in.pinterest.com\/artoftesting\/","https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q"]},{"@type":"Person","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5","name":"Kuldeep Rana","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","caption":"Kuldeep Rana"},"description":"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals."}]}},"_links":{"self":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":0,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media\/1584"}],"wp:attachment":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}