PageSourceSearch

https://docs-production-katalon.netlify.app/assets/js/ca2daa10.02f3c494.js

js docs-production-katalon.netlify.app collected 2026-10-03 10:40:00 UTC 8,443 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[1104],{28453:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>l});var a=t(96540);const n={},c=a.createContext(n);function r(e){const s=a.useContext(c);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:r(e.components),a.createElement(c.Provider,{value:s},e.children)}},36230:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>a,toc:()=>d});const a=JSON.parse('{"id":"create-test-cases/statements/branching-statements","title":"Branching Statements","description":"Note: Once a test step is added as any of the control statements, it is not allowed to change into another keyword.","source":"@site/docs/katalon-studio/create-test-cases/statements/branching-statements.md","sourceDirName":"create-test-cases/statements","slug":"/create-test-cases/statements/branching-statements","permalink":"/katalon-studio/create-test-cases/statements/branching-statements","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1758935351000,"frontMatter":{"title":"Branching Statements"},"sidebar":"katalon-studio","previous":{"title":"Looping Statements","permalink":"/katalon-studio/create-test-cases/statements/looping-statements"},"next":{"title":"Exception Handling Statements","permalink":"/katalon-studio/create-test-cases/statements/exception-handling-statements"}}');var n=t(74848),c=t(28453),r=t(86025);const l={title:"Branching Statements"},i=void 0,o={},d=[{value:'<a class="anchor_top_offset"></a>In manual view',id:"in-manual-view",level:2},{value:'<a class="anchor_top_offset"></a>In script view',id:"in-script-view",level:2}];function h(e){const s={h2:"h2",...(0,c.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:(0,n.jsxs)("div",{className:"note note note_note",children:[(0,n.jsx)("span",{className:"note__title",children:"Note:"})," ",(0,n.jsx)("ul",{className:"ul",children:(0,n.jsx)("li",{className:"li",children:(0,n.jsx)("p",{className:"p",children:"Once a test step is added as any of the control statements, it is not allowed to change into another keyword."})})})]})}),"\n",(0,n.jsxs)(s.h2,{id:"in-manual-view",children:[(0,n.jsx)("a",{id:"task-9176",class:"anchor_top_offset"}),"In manual view"]}),"\n",(0,n.jsxs)("ol",{xmlns:"http://www.w3.org/1999/xhtml",className:"ol steps",children:[(0,n.jsxs)("li",{className:"li step stepexpand",children:[(0,n.jsxs)("span",{className:"ph cmd",children:["Open a test case in\xa0 ",(0,n.jsx)("span",{className:"ph uicontrol",children:"Manual"})," \xa0view. Click on the drop-down icon of the ",(0,n.jsx)("span",{className:"ph uicontrol",children:"Add"})," button, then choose ",(0,n.jsx)("span",{className:"ph uicontrol",children:"Branching Statements"}),"."]}),(0,n.jsx)("div",{className:"itemgroup info",children:(0,n.jsx)("img",{className:"image",width:500,src:(0,r.Ay)("/8fdb9950-22b2-11ed-9930-0242fe3e4a3f/branching-statement.png"),alt:"Branching statements"})})]}),(0,n.jsxs)("li",{className:"li step stepexpand",children:[(0,n.jsxs)("span",{className:"ph cmd",children:["To add a keyword under a statement, select that statement, then click ",(0,n.jsx)("span",{className:"ph uicontrol",children:"Add"})," . A test step is created under that statement. "]}),(0,n.jsxs)("div",{className:"itemgroup info",children:[(0,n.jsx)("img",{className:"image",width:600,src:(0,r.Ay)("/8fdd6e10-22b2-11ed-9930-0242fe3e4a3f/break-continue-return.png"),alt:"branching statement in manual view"}),(0,n.jsx)("p",{className:"p",children:"Refer to the following table for the usage of each statement:"})]}),(0,n.jsx)("div",{className:"itemgroup info",children:(0,n.jsxs)("table",{className:"table anchor_top_offset",id:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f",children:[(0,n.jsx)("caption",{}),(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{}),(0,n.jsx)("col",{})]}),(0,n.jsx)("thead",{className:"thead",children:(0,n.jsxs)("tr",{className:!0,children:[(0,n.jsx)("th",{className:"entry anchor_top_offset",id:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1",children:"Statement"}),(0,n.jsx)("th",{className:"entry anchor_top_offset",id:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2",children:"Description"})]})}),(0,n.jsxs)("tbody",{className:"tbody",children:[(0,n.jsxs)("tr",{className:!0,children:[(0,n.jsx)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:"Break"}),(0,n.jsxs)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:[(0,n.jsx)("span",{className:"ph",children:"Katalon Studio"})," exits the current code block and continues to the next code block/test step."]})]}),(0,n.jsxs)("tr",{className:!0,children:[(0,n.jsx)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:"Continue"}),(0,n.jsxs)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:[(0,n.jsx)("span",{className:"ph",children:"Katalon Studio"})," skips the remainder of the current loop and continues with the next iteration of the loop."]})]}),(0,n.jsxs)("tr",{className:!0,children:[(0,n.jsx)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:"Return"}),(0,n.jsx)("td",{className:"entry",headers:"task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__1 task-9176__54a57d81-566f-475e-b03a-62468c2ae71f__entry__2 ",children:"Katalon exits from the current method/step, and the flow control is returned to where the method/step was invoked."})]})]})]})})]})]}),"\n",(0,n.jsxs)(s.h2,{id:"in-script-view",children:[(0,n.jsx)("a",{id:"concept-801",class:"anchor_top_offset"}),"In script view"]}),"\n",(0,n.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[" The ",(0,n.jsx)("span",{className:"ph uicontrol",children:"Script"})," \xa0view of test cases allows you to programmatically define and handle ",(0,n.jsx)("strong",{className:"ph b",children:"Break"})," , ",(0,n.jsx)("strong",{className:"ph b",children:"Continue"})," and ",(0,n.jsx)("strong",{className:"ph b",children:"Return"})," , using either Groovy or Java language.\xa0 "]}),"\n",(0,n.jsx)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:"For example:"}),"\n",(0,n.jsx)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:(0,n.jsxs)("li",{className:"li",children:[(0,n.jsx)("strong",{className:"ph b",children:"Break"})," : "]})}),"\n",(0,n.jsx)("pre",{xmlns:"http://www.w3.org/1999/xhtml",className:"pre codeblock",children:(0,n.jsxs)("code",{children:["for (int i = 0; i < max; i++) ","{"," // interested only in p's if (searchMe.charAt(i) != 'p') ","{"," break; ","}"," // process p's numPs++; ","}","\n","            "]})}),"\n",(0,n.jsx)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:(0,n.jsxs)("li",{className:"li",children:[(0,n.jsx)("strong",{className:"ph b",children:"Continue"})," : "]})}),"\n",(0,n.jsx)("pre",{xmlns:"http://www.w3.org/1999/xhtml",className:"pre codeblock",children:(0,n.jsxs)("code",{children:["for (int i = 0; i < max; i++) ","{"," // interested only in p's if (searchMe.charAt(i) != 'p') ","{"," continue; ","}"," // process p's numPs++; ","}","\n","            "]})}),"\n",(0,n.jsx)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:(0,n.jsxs)("li",{className:"li",children:[(0,n.jsx)("strong",{className:"ph b",children:"Return"})," : "]})}),"\n",(0,n.jsx)("pre",{xmlns:"http://www.w3.org/1999/xhtml",className:"pre codeblock",children:(0,n.jsxs)("code",{children:["for (int i = 0; i < max; i++) ","{"," // interested only in p's if (searchMe.charAt(i) != 'p') ","{"," return true; ","}"," // process p's numPs++; ","}","\n","            "]})})]})}function m(e={}){const{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.