{"id":1302,"date":"2012-03-03T18:01:34","date_gmt":"2012-03-03T12:31:34","guid":{"rendered":"http:\/\/www.automationrepository.com\/?p=1302"},"modified":"2012-03-03T18:16:11","modified_gmt":"2012-03-03T12:46:11","slug":"qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp","status":"publish","type":"post","link":"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/","title":{"rendered":"Part 7: QTP and VBScript | Writing Sub Procedures &#038; Functions in QTP"},"content":{"rendered":"<div style=\"text-align: justify; font-family: Verdana;\">\n<p>Many a times when you are writing your test scripts, you might encounter some lines of code that need to be executed multiple times during the course of the script. Rather than repeating the same code in your script multiple number of times, the common practice is to create a function for it and call<!--more--> the function repeatedly. Let&#8217;s see how you can do this in QTP. This article would cover the following concepts &#8211;<\/p>\n<ul>\n<li><strong>&#8212; What are procedures in VBScript and how they are used<\/strong><\/li>\n<li><strong>&#8212; What are Subs in QTP<\/strong><\/li>\n<li><strong>&#8212; Examples of how you can create Subs in QTP<\/strong><\/li>\n<li><strong>&#8212; Examples on passing parameters in Subs<\/strong><\/li>\n<li><strong>&#8212; Functions in QTP and their features<\/strong><\/li>\n<li><strong>&#8212; Creating Functions in QTP and passing parameters to a Function<\/strong><\/li>\n<li><strong>&#8212; Difference between a Sub and a Function<\/strong><\/li>\n<li><strong>&#8212; Example on how to return a value from a Function<\/strong><\/li>\n<li><strong>&#8212; Passing parameters by Value and by Reference<\/strong><\/li>\n<\/ul>\n<p>Let&#8217;s get started with these concepts..<br \/>\n<span><br \/>\n<\/span><\/p>\n<h3>Procedures in QTP<\/h3>\n<p>The grouping of the lines of code to execute it repeatedly can be broadly classified as Procedures. In QTP, you have two different types of procedures &#8211; <strong>Sub<\/strong> Procedures and <strong>Functions<\/strong>. Both of them work the same way expect for some minor differences. We&#8217;ll cover both these types of procedures in the later part of the article.<br \/>\n<span><br \/>\n<\/span><\/p>\n<h3>Executing a Procedure in QTP<\/h3>\n<p>Any Procedure (Function\/Sub) in VBScript has two main aspects which are mandatory for executing it in VBScript or for that matter any other programming language. These are &#8211;<\/p>\n<ul>\n<li><span style=\"text-decoration: underline;\">Function (Sub) Definition or Declaration<\/span>: Function Definition is the actual code that you want to run as part of the function<\/li>\n<li><span style=\"text-decoration: underline;\">Function Call<\/span>: This is a statement which executes your Function or Sub<\/li>\n<\/ul>\n<p>Let&#8217;s see an example of this where we would create a function to find the sum of two numbers and display the result.<br \/>\n<em> <\/em><br \/>\n<strong>Sample Code 1: Structure of a Procedure (Function &amp; Sub)<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'Structure for Sub\r\n'====================\r\n\r\n'1) Sub Definition - Actual Code\r\nSub fnSum()\r\n  var1 = 5 : var2 = 10\r\n  sum = var1 + var2\r\n  msgbox &quot;The Sum of Numbers is: &quot; &amp; sum\r\nEnd Sub\r\n\r\n'2) Executing Sub\r\nCall fnSum() 'Call keyword is not mandatory to execute a Sub\r\nfnSum()\r\n\r\n'Structure for Function\r\n'======================\r\n\r\n'1) Function Definition - Actual Code\r\nFunction fnSum()\r\n  var1 = 5 : var2 = 10\r\n  sum = var1 + var2\r\n  msgbox &quot;The Sum of Numbers is: &quot; &amp; sum\r\nEnd Function\r\n\r\n'2) Executing Function\r\nCall fnSum() 'Call keyword is not mandatory to execute a Function\r\nfnSum()\r\n<\/pre>\n<p><em>In the above example you can see that Call statement can also be used while calling a function\/sub. To know more about Call statement you can check the <a title=\"Difference between Call Statement and normal Function Call in QTP\" href=\"http:\/\/www.automationrepository.com\/2011\/09\/difference-between-call-statement-and-normal-function-call-in-qtp\/\" target=\"_blank\">difference between Call statement and normal function call<\/a>.<\/em><br \/>\n<span><br \/>\n<\/span><\/p>\n<h3>Subs in QTP<\/h3>\n<p>A Sub Procedure in QTP &#8211;<\/p>\n<ul>\n<li>&#8211; is a collection of statements that are enclosed between <strong>Sub<\/strong> and <strong>End Sub<\/strong> statements.<\/li>\n<li>&#8211; can be used both with and without parameters.<\/li>\n<li><strong>&#8211; does not return any value<\/strong>.<\/li>\n<\/ul>\n<p><span><br \/>\n<\/span><\/p>\n<h3>Passing Parameters in a Sub Procedure<\/h3>\n<p>Consider a situation where you want to run the same set of code multiple times but with different set of data. In such a case, you can pass the data to your Sub in the form of parameters. This way you can make the code generic which can work with multiple set of data. Let&#8217;s see an example for the same.<\/p>\n<p><strong>Sample Code 2: Using Parameters in a Sub<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim v1, v2\r\nv1=5 : v2=10\r\n\r\nfnSum v1, v2 'Passing parameters using variables\r\nfnSum 10, 20 'Passing parameters as literals\r\nfnSum v1+10, v2*2 'Passing parameters as expression\r\n\r\n'Sub Definition\r\nSub fnSum(var1, var2)\r\n  sum = var1 + var2\r\n  msgbox &quot;The sum of numbers is: &quot; &amp; sum\r\nEnd Sub\r\n<\/pre>\n<p><span><br \/>\n<\/span><\/p>\n<h3>Functions in QTP<\/h3>\n<p>A Function in QTP &#8211;<\/p>\n<ul>\n<li>&#8211; is a set of statements that are enclosed between <strong>Function<\/strong> and <strong>End Function<\/strong> statements.<\/li>\n<li>&#8211; can be used with and without parameters<\/li>\n<li><strong>&#8211; can return a value.<\/strong><\/li>\n<\/ul>\n<p><strong>The difference between a function and a sub is that a function can return a value, but a sub can&#8217;t return any value.<\/strong><br \/>\n<span><br \/>\n<\/span><\/p>\n<h3>Passing Parameters in a Function<\/h3>\n<p>You can pass parameters in a function the same way it&#8217;s done for a sub. Let&#8217;s see an example for this.<br \/>\n<strong>Sample Code 3: Using Parameters in a Function<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim v1, v2\r\nv1=5 : v2=10\r\nfnSum v1, v2 'Passing parameters using variables\r\nfnSum 10, 20 'Passing parameters as literals\r\nfnSum v1+10, v2*2 'Passing parameters as expressions\r\n'Function Definition\r\nFunction fnSum(var1, var2)\r\n  sum = var1 + var2\r\n  msgbox &quot;The sum of numbers is: &quot; &amp; sum\r\nEnd Function\r\n<\/pre>\n<p><span><br \/>\n<\/span><\/p>\n<h3>Returning a value from a Function in QTP<\/h3>\n<p>One additional advantage that Functions have over Sub is that a Function can return a value. To return a value from a function, we need to take care of the following two things &#8211;<\/p>\n<ul>\n<li>1) To return a value from a function, you need to use the statement <strong>functionName = ReturnValue<\/strong>, where functionName is the actual name of the function and ReturnValue is the value you want to return.<\/li>\n<li>2) To capture the returned value, you need to use the statement <strong>someVariable = <strong>functionName<\/strong>()<\/strong> while calling the function.<\/li>\n<\/ul>\n<p>Let&#8217;s understand this with the help of an example.<br \/>\n<em> <\/em><br \/>\n<strong>Sample Code 4: Returning value from a Function<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim result 'variable that will capture the result\r\n\r\nresult = fnSum(10, 20) 'parameters should be passed using parenthesis when the function returns a value\r\nmsgbox &quot;The sum of the numbers is:  &quot; &amp; result\r\n\r\n'Function Definition\r\nFunction fnSum(var1, var2)\r\n  sum = var1 + var2\r\n  'return the result\r\n  fnSum = sum\r\nEnd Function\r\n<\/pre>\n<p><span><br \/>\n<\/span><\/p>\n<h3>Passing Parameters to a Function\/Sub &#8211; Pass By Value &amp; Pass By Reference<\/h3>\n<p>You can pass parameters to a function or sub procedure by value or by reference. Let&#8217;s see what both these terms mean.<br \/>\n<em> <\/em><br \/>\n<strong>Passing Parameters by Value (byVal). <\/strong>With this way of passing parameters, only a copy of the original parameters is passed. This means that whatever modifications we make to the parameters inside the function, it doesn&#8217;t affect the original parameters.<\/p>\n<p><em> <\/em><br \/>\n<strong>Sample Code 5: Passing parameters by value to a function<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim val\r\nval=5\r\n\r\n'Function Call\r\nfnFunc val\r\nmsgbox &quot;Original Value: &quot; &amp; val 'msgbox displays value 5\r\n\r\n'Function Definition\r\nFunction fnFunc(byVal val)\r\n  val = val + 2\r\n  msgbox &quot;New Value: &quot; &amp; val 'msgbox displays value 7\r\nEnd Function\r\n<\/pre>\n<p><em>In the above example you would see that the new value get changed to 7 but it doesn&#8217;t get reflected to the original value which still shows the value as 5 only.<\/em><br \/>\n<em> <\/em><br \/>\n<em> <\/em><br \/>\n<strong>Passing Parameters by Reference (byRef). <\/strong>In this case, the reference of the original value is passed as the parameter to the function. Therefore, whatever change is done to the parameter inside the function, the same is reflected in the original parameter also. By default, values are passed by reference in a function. i.e., even if you don&#8217;t use byRef keyword, the parameters are passed by reference.<\/p>\n<p><em> <\/em><br \/>\n<strong>Sample Code 6: Passing parameters by reference to a function<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim val\r\nval=5\r\n'Function Call\r\nfnFunc val\r\nmsgbox &quot;Original Value: &quot; &amp; val 'msgbox displays value 7\r\n'Function Definition\r\nFunction fnFunc(ByRef val)\r\n  val = val + 2\r\n  msgbox &quot;New Value: &quot; &amp; val 'msgbox displays value 7\r\nEnd Function\r\n<\/pre>\n<p><em>Since the original parameter is passed as reference to the function, both the original and new value has the updated value 7.<\/em><br \/>\n<em> <\/em><br \/>\nThis was all about Functions and Sub Procedures in QTP. Please feel free to provide your feedback for this article and the entire <a title=\"QTP VBScript Tutorial\" href=\"http:\/\/www.automationrepository.com\/category\/qtp-and-vbscript-tutorials\/\" target=\"_blank\">QTP VBScript tutorial<\/a> series. You can also leave a comment if you would like any other details to be covered here.<br \/>\n<span><br \/>\n<\/span><\/p>\n<\/div>\n<div style=\"font-family: Verdana,sans-serif; border: 1px solid #C8B560; padding: 3mm; background: #FFF8C6; text-align: center;\">\n<p><strong>If you enjoyed this article, you can join our blog to get new articles delivered directly in your inbox.<\/strong><\/p>\n<form style=\"text-align: center;\" action=\"http:\/\/feedburner.google.com\/fb\/a\/mailverify\" method=\"post\" onsubmit=\"window.open('http:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=automationrepository\/feeds', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true\" target=\"popupwindow\"><input style=\"width: 160px; height: 20px;\" onfocus=\"if (this.value == 'Enter Your Email Address') {this.value = '';}\" onblur=\"if (this.value == '') {this.value = 'Enter Your Email Address';}\" type=\"text\" value=\"Enter Your Email Address\" \/> <input type=\"hidden\" name=\"uri\" value=\"automationrepository\/feeds\" \/> <input type=\"hidden\" name=\"loc\" value=\"en_US\" \/> <input type=\"submit\" value=\"Join Us\" \/><\/p>\n<p style=\"text-align: justify;\">\n<\/form>\n<\/div>\n<p style=\"border: 1px solid #C38EC7; padding: 3mm; background: #EBDDE2;\">To check out more tutorials, visit our <a title=\"QTP Tutorials\" href=\"http:\/\/www.automationrepository.com\/tutorials-for-qtp-beginners\/\" target=\"_blank\">QTP Tutorials<\/a> page. You can also check the <a title=\"All Articles\" href=\"http:\/\/www.automationrepository.com\/archive\/\" target=\"_blank\">Archives<\/a> page to view the list of all our articles.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many a times when you are writing your test scripts, you might encounter some lines of code that need to be executed multiple times during the course of the script. Rather than repeating the same code in your script multiple number of times, the common practice is to create a function for it and call<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,37],"tags":[89,90,10,88,87,86],"class_list":["post-1302","post","type-post","status-publish","format-standard","hentry","category-qtp-and-vbscript-tutorials","category-qtp-tutorials-for-beginners","tag-byref","tag-byval","tag-call-statement","tag-end-function","tag-end-sub","tag-sub"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>QTP &amp; VBScript | Writing Functions and Sub Procedures in QTP<\/title>\n<meta name=\"description\" content=\"This article describes how to create functions &amp; sub procedures in QTP, pass parameters (byVal &amp; byRef) in a function &amp; return a value.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anish Pillai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/\",\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/\",\"name\":\"QTP & VBScript | Writing Functions and Sub Procedures in QTP\",\"isPartOf\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#website\"},\"datePublished\":\"2012-03-03T12:31:34+00:00\",\"dateModified\":\"2012-03-03T12:46:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20\"},\"description\":\"This article describes how to create functions & sub procedures in QTP, pass parameters (byVal & byRef) in a function & return a value.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.automationrepository.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Part 7: QTP and VBScript | Writing Sub Procedures &#038; Functions in QTP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#website\",\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/\",\"name\":\"XX\",\"description\":\"\\r\\nasas\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.automationrepository.com\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20\",\"name\":\"Anish Pillai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g\",\"caption\":\"Anish Pillai\"},\"description\":\"Find more about Anish Pillai on Google+\",\"sameAs\":[\"http:\/\/www.automationrepository.com\"],\"url\":\"https:\/\/www.automationrepository.com\/wordpress\/author\/anish\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"QTP & VBScript | Writing Functions and Sub Procedures in QTP","description":"This article describes how to create functions & sub procedures in QTP, pass parameters (byVal & byRef) in a function & return a value.","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:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/","twitter_misc":{"Written by":"Anish Pillai","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/","url":"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/","name":"QTP & VBScript | Writing Functions and Sub Procedures in QTP","isPartOf":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/#website"},"datePublished":"2012-03-03T12:31:34+00:00","dateModified":"2012-03-03T12:46:11+00:00","author":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20"},"description":"This article describes how to create functions & sub procedures in QTP, pass parameters (byVal & byRef) in a function & return a value.","breadcrumb":{"@id":"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.automationrepository.com\/wordpress\/2012\/03\/qtp-vbscript-tutorials-sub-procedure-functions-in-vbscript-qtp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.automationrepository.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Part 7: QTP and VBScript | Writing Sub Procedures &#038; Functions in QTP"}]},{"@type":"WebSite","@id":"https:\/\/www.automationrepository.com\/wordpress\/#website","url":"https:\/\/www.automationrepository.com\/wordpress\/","name":"XX","description":"\r\nasas","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.automationrepository.com\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/7a35710e1ce89e5fb481be88fcd6cd20","name":"Anish Pillai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.automationrepository.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8aa984de2295c3c4078fa48f6ba5d91e7c849b1a27a11dca24c6f11dd673ba14?s=96&d=mm&r=g","caption":"Anish Pillai"},"description":"Find more about Anish Pillai on Google+","sameAs":["http:\/\/www.automationrepository.com"],"url":"https:\/\/www.automationrepository.com\/wordpress\/author\/anish\/"}]}},"_links":{"self":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/1302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1302"}],"version-history":[{"count":31,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/1302\/revisions"}],"predecessor-version":[{"id":1333,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/posts\/1302\/revisions\/1333"}],"wp:attachment":[{"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.automationrepository.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}