{"id":104168,"date":"2018-08-13T09:32:30","date_gmt":"2018-08-13T09:32:30","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=104168"},"modified":"2018-08-18T05:08:59","modified_gmt":"2018-08-18T05:08:59","slug":"artillery-io-getting-started","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/","title":{"rendered":"Getting started with Artillery.io"},"content":{"rendered":"<p>Load testing, one of many valuable testing methods you can use before release to ensure that your application is bug-free and runs seamlessly. The main process of load testing is, whether an application can withstand the load of concurrent users, requests, and data volumes when in use. Artillery.io is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery.io load testing tool is a Modern, Powerful &amp; Easy to use the tool.<\/p>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Key Features :<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<ul>\n<li>Supports multiple protocols- HTTP(S), WEbSockets and Socket.io<\/li>\n<li>Software prefered by ecommerce backends, loT bankends and transactional APIs<\/li>\n<li>Artillery is open source under MPLv2, which is an OSI-approved, permissive, and non-viral license.<\/li>\n<li>We can see response times\/latency percentiles, requests per second, concurrency, throughput, or track custom application-specific metrics with a tiny bit of Javascript code.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Installation<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<ul>\n<li>Before installing artillery, Install the Latest version of Node in your device. To Install Artillery tool, Run the following command in Command Prompt<br \/>\n<strong>npm install -g artillery<\/strong><\/li>\n<\/ul>\n<ul>\n<li>To check Artillery Installed or Not, run this command<br \/>\n<strong>artillery -V<\/strong><\/li>\n<\/ul>\n<p>You should see Artillery print its version if the installation has been successful.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Running Artillery Script<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<ul>\n<li>\u00a0Artillery allows users to run custom test scripts written in either yaml or json, users can also perform a quick test without loading external scripts. The following command specifies 20 GET requests to be sent every second for 10 seconds creating 10 virtual users per request.<br \/>\n<strong style=\"font-size: 16px\">artillery quick &#8211;count <span class=\"hljs-number\">10<\/span> -n <span class=\"hljs-number\">20<\/span> https:\/\/your-local-site-to-be.tested<\/strong><\/li>\n<li>Artillery is able to simulate realistic user behaviour with scenarios. The <strong>quick<\/strong> command can be useful for very simple tests only. Now let&#8217;s see how can we run a test.yaml and get the load testing results<\/li>\n<\/ul>\n<pre class=\"brush:xml\">config:\r\n  target: https:\/\/your-website-link\r\n  phases:\r\n    - duration: 10\r\n      arrivalRate: 10\r\nscenarios:\r\n  - flow:\r\n      - get:\r\n          # add the url you need to send get request\r\n          url: \"\/\"\r\n          capture:\r\n          # capturing responce using reg expression\r\n            - regexp: \"[^]*\"\r\n              as: \"response\"\r\n      - log: \"response= {{response}}\"<\/pre>\n<p>In this script, we specify that we are testing a service running on\u00a0https:\/\/your-website-link\u00a0\u00a0which will be talking to over HTTP. Scenarios are actions that the users would be performing within the website e.g searching, carting items, registration etc. \u00a0Scenarios are written in the configuration file which is used to run a custom test. Artillery.io also allows users to specify a file from which values can be imported to be used in a scenario.\u00a0We define one load phase, which will last 10 seconds with 10 new virtual users, arriving every second (on average). We capture the response using regular expression and stores it in a variable &#8220;response&#8221;. The &#8220;response&#8221; is logged using -log at the end. We can now run the above yaml file using the following command:<br \/>\n<strong>artillery run test.yaml<\/strong><\/p>\n<\/div>\n<\/div>\n<div class=\"panel panel-primary\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Reading Artillery response<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>Artillery provides feedback for each request sent which look something like :<\/p>\n<pre class=\"brush:xml\">Started phase 0, duration: 10s @ 14:27:36(+0530) 2018-08-13\r\n\r\nReport @ 14:27:38(+0530) 2018-08-13\r\n  Scenarios launched:  10\r\n  Scenarios completed: 10\r\n  Requests completed:  10\r\n  RPS sent: 2.13\r\n  Request latency:\r\n    min: 401\r\n    max: 401\r\n    median: 401\r\n    p95: 401\r\n    p99: 401\r\n  Codes:\r\n    200: 100<\/pre>\n<p>A range of different statistics are displayed in the response including the number of requests, a latency report for each request, duration of each scenario ran and any HTTP status codes returned from the response. The response is printed every ten seconds by default and a final response is then printed after the test has been completed with an aggregate statistic of all the tests ran.<\/p>\n<p>Request latency and scenario duration are recorded in milliseconds, p95 and p99 values represent 95th and 99th percentile values. NaN is returned if there are not enough responses received to perform the calculation.<br \/>\nIf there are any errors (such as socket timeouts), those will be printed under Errors in the report as well.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>To read about the HTTP load testing via artillery click <a href=\"https:\/\/webkul.com\/blog\/artillery-http-load-testing\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<br \/>\nSuggestion are highly appreciated in the comments \ud83d\ude00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Load testing, one of many valuable testing methods you can use before release to ensure that your application is bug-free and runs seamlessly. The main process of load testing is, whether an application can withstand the load of concurrent users, requests, and data volumes when in use. Artillery.io is a tool for generating load on <a href=\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":94,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4312,3498,3137,4932],"tags":[7276,7281,7320,7277,7280,7279,7278],"class_list":["post-104168","post","type-post","status-publish","format-standard","hentry","category-automation-testing","category-test-classes","category-testing","category-web-testing","tag-artillery","tag-artillery-load-test","tag-artillery-io","tag-getting-started-with-artillery","tag-load-test-via-artillery","tag-reading-artillery-report","tag-run-artillery-script"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Getting started with Artillery.io - Webkul Blog Automation testing<\/title>\n<meta name=\"description\" content=\"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with Artillery.io - Webkul Blog Automation testing\" \/>\n<meta property=\"og:description\" content=\"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-13T09:32:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-18T05:08:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Himanshu Chand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Himanshu Chand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\"},\"author\":{\"name\":\"Himanshu Chand\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f\"},\"headline\":\"Getting started with Artillery.io\",\"datePublished\":\"2018-08-13T09:32:30+00:00\",\"dateModified\":\"2018-08-18T05:08:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\"},\"wordCount\":571,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"artillery\",\"artillery load test\",\"artillery.io\",\"Getting Started With artillery\",\"load test via artillery\",\"reading artillery report\",\"run artillery script\"],\"articleSection\":[\"Automation testing\",\"Test Classes\",\"Testing\",\"Web testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\",\"url\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\",\"name\":\"Getting started with Artillery.io - Webkul Blog Automation testing\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2018-08-13T09:32:30+00:00\",\"dateModified\":\"2018-08-18T05:08:59+00:00\",\"description\":\"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting started with Artillery.io\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f\",\"name\":\"Himanshu Chand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Himanshu Chand\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/himanshu-chand168\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting started with Artillery.io - Webkul Blog Automation testing","description":"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...","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:\/\/webkul.com\/blog\/artillery-io-getting-started\/","og_locale":"en_US","og_type":"article","og_title":"Getting started with Artillery.io - Webkul Blog Automation testing","og_description":"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...","og_url":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-08-13T09:32:30+00:00","article_modified_time":"2018-08-18T05:08:59+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Himanshu Chand","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Himanshu Chand","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/"},"author":{"name":"Himanshu Chand","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f"},"headline":"Getting started with Artillery.io","datePublished":"2018-08-13T09:32:30+00:00","dateModified":"2018-08-18T05:08:59+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/"},"wordCount":571,"commentCount":1,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["artillery","artillery load test","artillery.io","Getting Started With artillery","load test via artillery","reading artillery report","run artillery script"],"articleSection":["Automation testing","Test Classes","Testing","Web testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/","url":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/","name":"Getting started with Artillery.io - Webkul Blog Automation testing","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2018-08-13T09:32:30+00:00","dateModified":"2018-08-18T05:08:59+00:00","description":"Artillery is a tool for generating load on HTTP, Socket.io and Web-Socket based applications. The artillery load testing tool is a Modern...","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/artillery-io-getting-started\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/artillery-io-getting-started\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Getting started with Artillery.io"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f","name":"Himanshu Chand","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Himanshu Chand"},"url":"https:\/\/webkul.com\/blog\/author\/himanshu-chand168\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/104168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=104168"}],"version-history":[{"count":16,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/104168\/revisions"}],"predecessor-version":[{"id":139265,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/104168\/revisions\/139265"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=104168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=104168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=104168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}