{"id":3657,"date":"2022-06-17T06:02:44","date_gmt":"2022-06-17T06:02:44","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/perform-validations-and-execute-tests-in-a-workflow\/"},"modified":"2022-06-17T06:02:44","modified_gmt":"2022-06-17T06:02:44","slug":"perform-validations-and-execute-tests-in-a-workflow","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/06\/17\/perform-validations-and-execute-tests-in-a-workflow\/","title":{"rendered":"Perform validations and execute tests in a workflow"},"content":{"rendered":"<p><html><body><\/p>\n<section class=\"tcb-post-content tcb-shortcode thrv_wrapper\" data-css=\"tve-u-16ec5d248bb\">\n<div class=\"tve_flt tcb-style-wrap\" id=\"tve_flt\">\n<div class=\"tve_shortcode_editor tar-main-content\" data-post-id=\"1932\" id=\"tve_editor\">\n<div class=\"thrv_wrapper tve-toc tve-elem-scroll tve-toc-expandable tcb-local-vars-root\" data-animation=\"slide\" data-animation-speed=\"fast\" data-bullet-style='{\"0\":\"tve-u-62ac19044659d4\",\"1\":\"tve-u-62ac1904465a01\",\"2\":\"tve-u-62ac1904465a27\"}' data-columns=\"1\" data-columns-d=\"1\" data-css=\"tve-u-62ac19044659b1\" data-ct=\"toc-60671\" data-ct-name=\"Table of Contents 03\" data-element-name=\"Table of Contents\" data-headers=\"h1,h3,h4\" data-heading-style='{\"0\":\"tve-u-62ac1904465820\",\"1\":\"tve-u-62ac1904465960\",\"2\":\"tve-u-62ac1904465994\"}' data-highlight=\"section\" data-number-style='{\"0\":\"tve-u-62ac1904465a49\",\"1\":\"tve-u-62ac1904465a63\",\"2\":\"tve-u-62ac1904465a92\"}' data-numbering=\"basic\" data-state-default=\"expanded\" data-transition=\"fade\" style=\"\">\n<div class=\"thrive-colors-palette-config\" style=\"display: none !important\"><\/div>\n<div class=\"tve-toc-divider\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\">\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-62ac1904465ab8\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<p><svg class=\"toc-icons\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-0\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-1\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-2\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><\/svg><\/p>\n<div class=\"tve-content-box-background\" data-css=\"tve-u-62ac1904465ae1\" style=\"\"><\/div>\n<div class=\"thrv_wrapper tve-toc-title show-icon tcb-icon-display tve-no-dropzone tve-prevent-content-edit\" data-css=\"tve-u-62ac1904465b05\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve-toc-title-icon\" data-icon-code=\"icon-arrow-circle-down-solid\" style=\"\"><svg class=\"tcb-icon\" data-id=\"icon-arrow-circle-down-solid\" data-name=\"\" viewbox=\"0 0 512 512\"><path d=\"M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z\"><\/path><\/svg><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve_no_icons\">\n<div class=\"tcb-plain-text\" style=\"\">Table of Contents<\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"tve-cb tve-toc-content tve-prevent-content-edit\">\n<div class=\"thrv_wrapper tve-toc-list tcb-no-delete tcb-no-save tcb-no-clone tve-no-dropzone\" data-css=\"tve-u-62ac1904465b24\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"tve_ct_content tve_clearfix\">\n<div class=\"ct_column\">\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac1904465960\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655640850441\" jump-animation=\"smooth\">Perform validations and execute tests in a workflow<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac1904465960\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655640850442\" jump-animation=\"smooth\">1. What you will Learn in this blog?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac1904465960\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655640850443\" jump-animation=\"smooth\">2. Perform \u2018status code 200\u2019 validation<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac1904465960\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655640850444\" jump-animation=\"smooth\">3. Perform string validation<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-62ac1904465960\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1655640850445\" jump-animation=\"smooth\">4. Execute all the tests in a collection as a single workflow<\/a><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-62ac1904465ab8\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1655640850441\"><b>Perform validations and execute tests in a workflow<\/b><\/h3>\n<p>Welcome you all to the brand new \u2018API Testing\u2019 blog series! In the previous blog, we had studied how to execute POST requests in Postman. We also studied how to chain GET and POST requests. In this tutorial, we will learn how to perform some validations. We will also learn how to execute all the tests in a single workflow!! So let us begin!!!\u00a0<\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px auto; text-align: center; display: block; clear: both;\">\n<p><!-- horizontal responsive 2 --><br \/>\n<ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-3231318496783163\" data-ad-format=\"auto\" data-ad-slot=\"2788468763\" data-full-width-responsive=\"true\" style=\"display:block\"><\/ins>\n<\/div>\n<h3 id=\"t-1655640850442\"><b><b>1. What you will Learn in this blog?<\/b><\/b><\/h3>\n<ul class=\"\">\n<li>Perform \u2018status code 200\u2019 validation<\/li>\n<li>Perform string validation<\/li>\n<li>Execute all the tests in a collection as a single workflow<\/li>\n<\/ul>\n<h3 class=\"\" id=\"t-1655640850443\"><b><b>2. <b>Perform \u2018status code 200\u2019 validation<\/b><\/b><\/b><\/h3>\n<p>Let us open the \u2018POSTwithParams\u2019 request from our collection<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be729f0\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2258\" data-css=\"tve-u-1817be738be\" data-height=\"316\" data-id=\"2258\" data-init-height=\"204\" data-init-width=\"300\" data-width=\"464\" decoding=\"async\" height=\"316\" loading=\"lazy\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-6-300x204.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-1-6-300x204.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-1-6.jpg 376w\" style=\"\" title=\"Image 1\" width=\"464\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Hit \u2018Send\u2019 and notice below that 200 status code is generated<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be79934\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2259\" data-css=\"tve-u-1817be7a4cf\" data-height=\"146\" data-id=\"2259\" data-init-height=\"90\" data-init-width=\"300\" data-width=\"488\" decoding=\"async\" height=\"146\" loading=\"lazy\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-6-300x90.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-2-6-300x90.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-2-6-1024x307.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-2-6-768x230.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-2-6.jpg 1083w\" style=\"\" title=\"Image 2\" width=\"488\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us see how to validate this status code.<\/p>\n<p>Go to the \u2018Tests\u2019 section of this Post request<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be7e558\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2260\" data-css=\"tve-u-1817be7f36c\" data-height=\"104\" data-id=\"2260\" data-init-height=\"61\" data-init-width=\"300\" data-width=\"513\" decoding=\"async\" height=\"104\" loading=\"lazy\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-6-300x61.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-3-6-300x61.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-3-6-768x155.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-3-6.jpg 781w\" style=\"\" title=\"Image 3\" width=\"513\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>On the right hand side, under snippets, look for<\/p>\n<p>\u2018<b>Status code: Code is 200<\/b>\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be834ff\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2261\" data-css=\"tve-u-1817be84101\" data-height=\"174\" data-id=\"2261\" data-init-height=\"104\" data-init-width=\"300\" data-width=\"503\" decoding=\"async\" height=\"174\" loading=\"lazy\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-7-300x104.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-4-7-300x104.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-4-7.jpg 691w\" style=\"\" title=\"Image 4\" width=\"503\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click this snippet.<\/p>\n<p>Notice below, a function is generated to validate the status 200<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be8835f\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2262\" data-css=\"tve-u-1817be89028\" data-height=\"150\" data-id=\"2262\" data-init-height=\"84\" data-init-width=\"300\" data-width=\"537\" decoding=\"async\" height=\"150\" loading=\"lazy\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-6-300x84.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-5-6-300x84.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-5-6-768x214.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-5-6.jpg 905w\" style=\"\" title=\"Image 5\" width=\"537\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018Send\u2019<\/p>\n<p>Go to the \u2018Test Results\u2019 section as shown below. We would see that our Test is \u2018PASS\u2019\u00a0<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be8cf99\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2263\" data-css=\"tve-u-1817be8dbba\" data-height=\"441\" data-id=\"2263\" data-init-height=\"252\" data-init-width=\"300\" data-width=\"525\" decoding=\"async\" height=\"441\" loading=\"lazy\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-6-300x252.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-6-6-300x252.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-6-6.jpg 469w\" style=\"\" title=\"Image 6\" width=\"525\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>We can also rename our \u2018Test\u2019 as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be91ba6\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2264\" data-css=\"tve-u-1817be92a16\" data-height=\"182\" data-id=\"2264\" data-init-height=\"105\" data-init-width=\"300\" data-width=\"520\" decoding=\"async\" height=\"182\" loading=\"lazy\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-6-300x105.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-7-6-300x105.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-7-6.jpg 546w\" style=\"\" title=\"Image 7\" width=\"520\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018Send\u2019.<\/p>\n<p>Notice below the \u2018Test\u2019 is PASS and the new test name is displayed viz \u2018Validate Status code\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be98ec7\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2265\" data-css=\"tve-u-1817be99a89\" data-height=\"440\" data-id=\"2265\" data-init-height=\"271\" data-init-width=\"300\" data-width=\"487\" decoding=\"async\" height=\"440\" loading=\"lazy\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-6-300x271.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-8-6-300x271.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-8-6.jpg 434w\" style=\"\" title=\"Image 8\" width=\"487\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us intentionally change status code 200 to 201 in our code snippet as shown below<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817be9ed2f\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2266\" data-css=\"tve-u-1817be9f8d0\" data-height=\"210\" data-id=\"2266\" data-init-height=\"119\" data-init-width=\"300\" data-width=\"529\" decoding=\"async\" height=\"210\" loading=\"lazy\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-6-300x119.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-9-6-300x119.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-9-6.jpg 542w\" style=\"\" title=\"Image 9\" width=\"529\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018Send\u2019<\/p>\n<p>Notice below that this time our \u2018Test\u2019 got failed and we get an assertion error. The assertion error simply means that we are expecting status code of 201 but the actual status code that we received from the server is 200. Hence our validation faied this time<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bea3fb0\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2267\" data-css=\"tve-u-1817bea4893\" data-height=\"139\" data-id=\"2267\" data-init-height=\"75\" data-init-width=\"300\" data-width=\"556\" decoding=\"async\" height=\"139\" loading=\"lazy\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-6-300x75.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-10-6-300x75.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-10-6-1024x255.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-10-6-768x191.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-10-6.jpg 1061w\" style=\"\" title=\"Image 10\" width=\"556\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655640850444\"><b><b>3. <b><b>Perform string validation<\/b><\/b><\/b><\/b><\/h3>\n<p>Let us now see how to perform string validation. If we go to the \u2018Body\u2019 of this Post request (see below), we can see some string values in the body (\u201ccountry\u201d: \u201cIndia\u201d)<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bec601a\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2268\" data-css=\"tve-u-1817bec6a2a\" data-height=\"353\" data-id=\"2268\" data-init-height=\"206\" data-init-width=\"300\" data-width=\"514\" decoding=\"async\" height=\"353\" loading=\"lazy\" sizes=\"auto, (max-width: 514px) 100vw, 514px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-6-300x206.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-11-6-300x206.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-11-6.jpg 524w\" style=\"\" title=\"Image 11\" width=\"514\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>How do we validate these strings?<\/p>\n<p>To validate strings, we have a snippet<\/p>\n<p>\u2018<b>Response body: Contains string<\/b>\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817becc610\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2269\" data-css=\"tve-u-1817beccf31\" data-height=\"173\" data-id=\"2269\" data-init-height=\"92\" data-init-width=\"300\" data-width=\"565\" decoding=\"async\" height=\"173\" loading=\"lazy\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-6-300x92.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-12-6-300x92.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-12-6-768x235.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-12-6.jpg 880w\" style=\"\" title=\"Image 12\" width=\"565\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click this snippet and notice below that one more function gets generated<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bed4961\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2270\" data-css=\"tve-u-1817bed52aa\" data-height=\"170\" data-id=\"2270\" data-init-height=\"98\" data-init-width=\"300\" data-width=\"521\" decoding=\"async\" height=\"170\" loading=\"lazy\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-6-300x98.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-13-6-300x98.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-13-6-768x251.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-13-6.jpg 1005w\" style=\"\" title=\"Image 13\" width=\"521\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us replace \u201cstring_you_want_to_search\u201d with \u201cIndia\u201d<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bed9612\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2271\" data-css=\"tve-u-1817beda310\" data-height=\"58\" data-id=\"2271\" data-init-height=\"33\" data-init-width=\"300\" data-width=\"523\" decoding=\"async\" height=\"58\" loading=\"lazy\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-6-300x33.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-14-6-300x33.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-14-6.jpg 689w\" style=\"\" title=\"Image 14\" width=\"523\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click Send.<\/p>\n<p>Notice below that the validation \u2018Body matches string\u2019 is PASS<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bede44d\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2272\" data-css=\"tve-u-1817bedeedf\" data-height=\"336\" data-id=\"2272\" data-init-height=\"193\" data-init-width=\"300\" data-width=\"522\" decoding=\"async\" height=\"336\" loading=\"lazy\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-6-300x193.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-15-6-300x193.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-15-6.jpg 686w\" style=\"\" title=\"Image 15\" width=\"522\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1655640850445\"><b><b>4. <b><b><b>Execute all the tests in a collection as a single workflow<\/b><\/b><\/b><\/b><\/b><\/h3>\n<p>Currently, we have 4 requests in our collection<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf48319\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2275\" data-css=\"tve-u-1817bf48da7\" data-height=\"287\" data-id=\"2275\" data-init-height=\"174\" data-init-width=\"300\" data-width=\"494\" decoding=\"async\" height=\"287\" loading=\"lazy\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-5-300x174.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-16-5-300x174.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-16-5.jpg 365w\" style=\"\" title=\"Image 16\" width=\"494\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Let us see how to execute all of these 4 requests as a single workflow.\u00a0<\/p>\n<p>But before we do that, let us add \u2018200 status\u2019 validations in the 2 GET requests<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf4dc6c\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2276 tcb-moved-image\" data-css=\"tve-u-1817bf4e511\" data-height=\"161\" data-id=\"2276\" data-init-height=\"92\" data-init-width=\"293\" data-width=\"512\" decoding=\"async\" height=\"161\" loading=\"lazy\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-17-4.jpg\" style=\"\" title=\"Image 17\" width=\"512\"\/><\/span><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf5063d\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2277\" data-css=\"tve-u-1817bf5177c\" data-height=\"222\" data-id=\"2277\" data-init-height=\"136\" data-init-width=\"300\" data-width=\"489\" decoding=\"async\" height=\"222\" loading=\"lazy\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-4-300x136.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-18-4-300x136.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-18-4-768x347.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-18-4.jpg 779w\" style=\"\" title=\"Image 18\" width=\"489\"\/><\/span><\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf52e95\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2278\" data-css=\"tve-u-1817bf53a79\" data-height=\"236\" data-id=\"2278\" data-init-height=\"145\" data-init-width=\"300\" data-width=\"489\" decoding=\"async\" height=\"236\" loading=\"lazy\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-4-300x145.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-19-4-300x145.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-19-4.jpg 755w\" style=\"\" title=\"Image 19\" width=\"489\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Save all the requests by clicking Save button<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf56e19\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2279\" data-css=\"tve-u-1817bf57acd\" data-height=\"191\" data-id=\"2279\" data-init-height=\"99\" data-init-width=\"136\" data-width=\"263\" decoding=\"async\" height=\"191\" loading=\"lazy\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-20-3.jpg\" style=\"\" title=\"Image 20\" width=\"263\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Close all the requests in the Workspace<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf5aad7\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2280\" data-css=\"tve-u-1817bf5b791\" data-height=\"232\" data-id=\"2280\" data-init-height=\"131\" data-init-width=\"300\" data-width=\"532\" decoding=\"async\" height=\"232\" loading=\"lazy\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-21-3-300x131.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-21-3-300x131.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-21-3-768x335.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-21-3.jpg 950w\" style=\"\" title=\"Image 21\" width=\"532\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click collection<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf61d39\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2281\" data-css=\"tve-u-1817bf633c9\" data-height=\"269\" data-id=\"2281\" data-init-height=\"161\" data-init-width=\"300\" data-width=\"502\" decoding=\"async\" height=\"269\" loading=\"lazy\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-22-3-300x161.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-22-3-300x161.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-22-3.jpg 330w\" style=\"\" title=\"Image 22\" width=\"502\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>On the right hand side, we will see \u2018View more actions\u2019 represented by 3 dots.<\/p>\n<p>Click these 3 dots, we will see the \u2018Run\u2019 option<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf6586b\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2282\" data-css=\"tve-u-1817bf66546\" data-height=\"93\" data-id=\"2282\" data-init-height=\"57\" data-init-width=\"300\" data-width=\"489\" decoding=\"async\" height=\"93\" loading=\"lazy\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-23-3-300x57.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-23-3-300x57.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-23-3-1024x195.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-23-3-768x146.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-23-3.jpg 1026w\" style=\"\" title=\"Image 23\" width=\"489\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click Run.<\/p>\n<p>See below. We can select\/de-select the checkboxes for the requests we want to run<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf67f31\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2283\" data-css=\"tve-u-1817bf68c22\" data-height=\"239\" data-id=\"2283\" data-init-height=\"136\" data-init-width=\"300\" data-width=\"528\" decoding=\"async\" height=\"239\" loading=\"lazy\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-24-3-300x136.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-24-3-300x136.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-24-3-1024x463.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-24-3-768x347.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-24-3.jpg 1070w\" style=\"\" title=\"Image 24\" width=\"528\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Leave all the options as default and click \u2018Run APIRequestsCollectionHttp\u2026\u2019<\/p>\n<p>The below window comes up showing 3 Passed and 1 Failed Test<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf6a6a1\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2284\" data-css=\"tve-u-1817bf6b51b\" data-height=\"239\" data-id=\"2284\" data-init-height=\"139\" data-init-width=\"300\" data-width=\"516\" decoding=\"async\" height=\"239\" loading=\"lazy\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-25-3-300x139.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-25-3-300x139.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-25-3-1024x476.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-25-3-768x357.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-25-3.jpg 1069w\" style=\"\" title=\"Image 25\" width=\"516\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>As expected, below 3 Tests Passed<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf6ced5\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2285\" data-css=\"tve-u-1817bf6dbba\" data-height=\"474\" data-id=\"2285\" data-init-height=\"300\" data-init-width=\"279\" data-width=\"441\" decoding=\"async\" height=\"474\" loading=\"lazy\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-26-3-279x300.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-26-3-279x300.jpg 279w, \/blog\/wp-content\/uploads\/2022\/06\/Image-26-3.jpg 428w\" style=\"\" title=\"Image 26\" width=\"441\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>As expected, the below Test failed<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf70205\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2286\" data-css=\"tve-u-1817bf70dd7\" data-height=\"184\" data-id=\"2286\" data-init-height=\"103\" data-init-width=\"300\" data-width=\"536\" decoding=\"async\" height=\"184\" loading=\"lazy\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-27-3-300x103.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-27-3-300x103.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-27-3.jpg 666w\" style=\"\" title=\"Image 27\" width=\"536\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Click \u2018View Summary\u2019<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf72ba2\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2287\" data-css=\"tve-u-1817bf736cc\" data-height=\"117\" data-id=\"2287\" data-init-height=\"74\" data-init-width=\"193\" data-width=\"304\" decoding=\"async\" height=\"117\" loading=\"lazy\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-28-3.jpg\" style=\"\" title=\"Image 28\" width=\"304\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>Notice below that we get a run summary which is self-explanatory<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1817bf7508a\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-2288\" data-css=\"tve-u-1817bf76a84\" data-height=\"197\" data-id=\"2288\" data-init-height=\"113\" data-init-width=\"300\" data-width=\"524\" decoding=\"async\" height=\"197\" loading=\"lazy\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" src=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-29-3-300x113.jpg\" srcset=\"\/blog\/wp-content\/uploads\/2022\/06\/Image-29-3-300x113.jpg 300w, \/blog\/wp-content\/uploads\/2022\/06\/Image-29-3-1024x385.jpg 1024w, \/blog\/wp-content\/uploads\/2022\/06\/Image-29-3-768x289.jpg 768w, \/blog\/wp-content\/uploads\/2022\/06\/Image-29-3.jpg 1153w\" style=\"\" title=\"Image 29\" width=\"524\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>So this is how we perform validations and execute the tests as workflows.<\/p>\n<p>In the next article, we will see how to handle cookies in postman.<\/p>\n<p>Thank you for reading!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb_flag\" style=\"display: none\"><\/div>\n<\/section>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents Perform validations and execute tests in a workflow 1. What you will Learn in this blog? 2. Perform \u2018status code 200\u2019 validation 3. Perform string validation 4. Execute all the tests in a collection as a single workflow Perform validations and execute tests in a workflow Welcome you all to the brand [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-3657","post","type-post","status-publish","format-standard","hentry","category-api","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=3657"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3657\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=3657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=3657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=3657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}