PageSourceSearch

https://docs-production-katalon.netlify.app/assets/js/b53d564e.9e439f30.js

js docs-production-katalon.netlify.app collected 2026-10-03 10:41:13 UTC 14,412 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[6161],{4778:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>n,toc:()=>m});const n=JSON.parse('{"id":"keywords/using-keywords-in-katalon-studio/mobile-testing/performing-pinch-to-zoom-in-action-in-katalon-studio","title":"Performing Pinch to Zoom In Action in Katalon Studio","description":"This tutorial is to test the Pinch To Zoom In   action in the mobile app. The app used for this demonstration can   be downloaded here. We will be using Android O.S for this tutorial,   so please make sure that your Android device API   is greater than 18.","source":"@site/docs/katalon-studio/keywords/using-keywords-in-katalon-studio/mobile-testing/performing-pinch-to-zoom-in-action-in-katalon-studio.md","sourceDirName":"keywords/using-keywords-in-katalon-studio/mobile-testing","slug":"/keywords/using-keywords-in-katalon-studio/mobile-testing/performing-pinch-to-zoom-in-action-in-katalon-studio","permalink":"/katalon-studio/keywords/using-keywords-in-katalon-studio/mobile-testing/performing-pinch-to-zoom-in-action-in-katalon-studio","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1758935351000,"frontMatter":{"title":"Performing Pinch to Zoom In Action in Katalon Studio"},"sidebar":"katalon-studio","previous":{"title":"Applitools integration in Katalon Studio","permalink":"/katalon-studio/keywords/using-keywords-in-katalon-studio/web-testing/applitools-integration-in-katalon-studio"},"next":{"title":"How to Perform Multi-touch Actions in Mobile App in Katalon Studio","permalink":"/katalon-studio/keywords/using-keywords-in-katalon-studio/mobile-testing/how-to-perform-multi-touch-actions-in-mobile-app-in-katalon-studio"}}');var s=o(74848),i=o(28453),a=o(86025);const l={title:"Performing Pinch to Zoom In Action in Katalon Studio"},r=void 0,c={},m=[{value:'<a class="anchor_top_offset"></a>Scenario',id:"scenario",level:2},{value:'<a class="anchor_top_offset"></a>Manual Mode',id:"manual-mode",level:2},{value:'<a class="anchor_top_offset"></a>Script Mode',id:"script-mode",level:2}];function h(e){const t={code:"code",h2:"h2",pre:"pre",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["This tutorial is to test the ",(0,s.jsx)("strong",{className:"ph b",children:"Pinch To Zoom In"}),"   action in the mobile app. The app used for this demonstration can   be downloaded here. We will be using Android O.S for this tutorial,   so please make sure that your Android device ",(0,s.jsx)("strong",{className:"ph b",children:"API"}),"   is ",(0,s.jsx)("strong",{className:"ph b",children:"greater"})," than ",(0,s.jsx)("strong",{className:"ph b",children:"18"}),"."]}),"\n",(0,s.jsxs)(t.h2,{id:"scenario",children:[(0,s.jsx)("a",{id:"id_1",class:"anchor_top_offset"}),"Scenario"]}),"\n",(0,s.jsx)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:'In the screenshot below, we want to zoom into "Hello World" and   verify the zoom-in action.'}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)(t.h2,{id:"manual-mode",children:[(0,s.jsx)("a",{id:"id_2",class:"anchor_top_offset"}),"Manual Mode"]}),"\n",(0,s.jsx)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:(0,s.jsxs)("li",{className:"li",children:["Step 1: Select ",(0,s.jsx)("strong",{className:"ph b",children:"Start       Application"})," from mobile keyword and click on     ",(0,s.jsx)("strong",{className:"ph b",children:"Input"})," it will open a window, where for appFile     select ",(0,s.jsx)("strong",{className:"ph b",children:"Value Type"})," as ",(0,s.jsx)("strong",{className:"ph b",children:"Variable"})," and     in ",(0,s.jsx)("strong",{className:"ph b",children:"Value"}),", pass the variable name as     ",(0,s.jsx)("strong",{className:"ph b",children:"path"})," and click ",(0,s.jsx)("strong",{className:"ph b",children:"OK."}),"   "]})}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test-1.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:[(0,s.jsxs)("li",{className:"li",children:["Step 2: Add a ",(0,s.jsx)("strong",{className:"ph b",children:"Wait For Element Present"})," item     for API Demos to show up."]}),(0,s.jsxs)("li",{className:"li",children:["Step 3: Call ",(0,s.jsx)("strong",{className:"ph b",children:"Scroll To Text"})," from mobile     keyword, pass ",(0,s.jsx)("strong",{className:"ph b",children:"Views"})," as Input. ",(0,s.jsx)("strong",{className:"ph b",children:"Scroll To       Text"})," accepts String type parameter (Text of the element to     scroll to)"]})]}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test-3.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:[(0,s.jsxs)("li",{className:"li",children:["Step 4: Call ",(0,s.jsx)("strong",{className:"ph b",children:"Tap"})," method and pass the object of     ",(0,s.jsx)("strong",{className:"ph b",children:"Views."}),"   "]}),(0,s.jsxs)("li",{className:"li",children:["Step 5: Select ",(0,s.jsx)("strong",{className:"ph b",children:"Scroll To Text"})," keyword and pass     the ",(0,s.jsx)("strong",{className:"ph b",children:"Tabs"})," text."]})]}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test-10.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:[(0,s.jsxs)("li",{className:"li",children:["Step 6: Call ",(0,s.jsx)("strong",{className:"ph b",children:"Tap"})," method and pass the object of     ",(0,s.jsx)("strong",{className:"ph b",children:"WebView"}),"   "]}),(0,s.jsxs)("li",{className:"li",children:["Step 7: Add ",(0,s.jsx)("strong",{className:"ph b",children:"wait commands"})," to wait for     '",(0,s.jsx)("strong",{className:"ph b",children:"Hello world"}),"' link to be visible."]}),(0,s.jsxs)("li",{className:"li",children:["Step 8: Call '",(0,s.jsx)("strong",{className:"ph b",children:"Get Element Height"}),"' method and     capture the of \"",(0,s.jsx)("strong",{className:"ph b",children:"Hello World"}),"\" height to store it in     a variable named '",(0,s.jsx)("strong",{className:"ph b",children:"ele_Height"}),"'."]}),(0,s.jsxs)("li",{className:"li",children:["Step 9: Call '",(0,s.jsx)("strong",{className:"ph b",children:"Get Element Width"}),"' method and     capture the of \"",(0,s.jsx)("strong",{className:"ph b",children:"Hello World"}),'" element     ',(0,s.jsx)("strong",{className:"ph b",children:"width"})," to store it in '",(0,s.jsx)("strong",{className:"ph b",children:"ele_Width"}),"'.   "]}),(0,s.jsxs)("li",{className:"li",children:["Step 10: Add '",(0,s.jsx)("strong",{className:"ph b",children:"Pinch To Zoom In At Position"}),"'     method from mobile keyword list and pass the following values in:     ",(0,s.jsxs)("strong",{className:"ph b",children:["ele",(0,s.jsx)("em",{className:"ph i",children:"Height"}),","]})," eleWidth,     ",(0,s.jsx)("strong",{className:"ph b",children:"Offset"})," value."]})]}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test-11.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("ul",{xmlns:"http://www.w3.org/1999/xhtml",className:"ul",children:[(0,s.jsxs)("li",{className:"li",children:["Step 11: After zooming in, we need to ",(0,s.jsx)("strong",{className:"ph b",children:"verify"}),"     that element has been zoomed. Thus, we need to re-capture the     element Height and Width."]}),(0,s.jsxs)("li",{className:"li",children:["Step 12: After zooming the element height and width     ",(0,s.jsx)("strong",{className:"ph b",children:"should be greater"})," than the existing height and     width in the test. By using '",(0,s.jsx)("strong",{className:"ph b",children:"Verify Greater Than"}),"'     method, we can validate the element height and width."]})]}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:[(0,s.jsx)("img",{className:"image",src:(0,a.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/tutorials/pinch_zoom_action_mobile_app/Performing-Pinch-to-Zoom-In-in-automation-test-12.png"),alt:"Performing Pinch to Zoom In in automation test"}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["As you can see from the step-by-step guide above, there are   repeated steps that will be easier to create in ",(0,s.jsx)("strong",{className:"ph b",children:"Script     Mode"}),". Thus, we suggest the users to utilize this feature   where one can quickly automate the test scenario and easily manage   test scripts."]}),"\n",(0,s.jsxs)(t.h2,{id:"script-mode",children:[(0,s.jsx)("a",{id:"id_3",class:"anchor_top_offset"}),"Script Mode"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject\nimport com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration\nimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile\nimport com.kms.katalon.core.model.FailureHandling as FailureHandling\n \n'Path of the Apk File Store in path variable'\ndef path = RunConfiguration.getProjectDir() + '/Data Files/ApiDemos.apk'\n \n'Start the application'\nMobile.startApplication(path, false)\n \n'Wait for element Present of Heading API Demos'\nMobile.waitForElementPresent(findTestObject('API Demos Objects/Zo
1om_IN/heading_API_Demos'), 45)\n \n'Checking the Element \"Heading API Demos\" is in Visible '\nMobile.verifyElementVisible(findTestObject('API Demos Objects/Zoom_IN/heading_API_Demos'), 30)\n \n'Scroll to Views text'\nMobile.scrollToText('Views', FailureHandling.STOP_ON_FAILURE)\n \n'Tap on Views'\nMobile.tap(findTestObject('API Demos Objects/Zoom_IN/text_Views'), 20)\n \n'Scroll to WebView text'\nMobile.scrollToText('WebView', FailureHandling.STOP_ON_FAILURE)\n \n'Checking the Element \"WebView\" is in Visible '\nMobile.verifyElementVisible(findTestObject('API Demos Objects/Zoom_IN/text_WebView'), 30)\n \n'Tap on WebView'\nMobile.tap(findTestObject('API Demos Objects/Zoom_IN/text_WebView'), 30)\n \n'Wait for Element Present \"Hello World\"'\nMobile.waitForElementPresent(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Checking the Element \"Hello World\" is in Visible '\nMobile.verifyElementVisible(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Get Element Height of \"Hello World\" Element'\nele_Height = Mobile.getElementHeight(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Get Element Width of \"Hello World\" Element'\nele_Width = Mobile.getElementWidth(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Pinch to Zoom In on \"Hello World\" Element up to 200 Offset'\nMobile.pinchToZoomInAtPosition(ele_Height, ele_Width, 200)\n \n'Get Element Height of  Zoom In \"Hello World\" Element'\nzoom_ele_Height = Mobile.getElementHeight(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Get Element Width of Zoom In \"Hello World\" Element'\nzoom_ele_Width = Mobile.getElementWidth(findTestObject('API Demos Objects/Zoom_IN/link_Hello World'), 30)\n \n'Verify the Element Height of Zoom In greater than normal Element height'\nMobile.verifyGreaterThan(zoom_ele_Height, ele_Height)\n \n'Verify the Element Width of Zoom In greater than normal Element Width'\nMobile.verifyGreaterThan(zoom_ele_Width, ele_Width)\n \n'Close the Application.'\nMobile.closeApplication()\n"})}),"\n",(0,s.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["The source code is available ",(0,s.jsx)("a",{className:"xref j-external-link",href:"https://github.com/katalon-studio/katalon-mobile-automation",target:"_blank",children:"here"}),". For   further instructions and help, please refer to ",(0,s.jsx)("a",{className:"xref",href:"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-pinch-to-zoom-in-at-position",children:"Pinch     To Zoom In At Position"})," guide and join us on ",(0,s.jsx)("a",{className:"xref j-external-link",href:"http://forum.katalon.com/",target:"_blank",children:"Katalon Forum"}),"."]})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},28453:(e,t,o)=>{o.d(t,{R:()=>a,x:()=>l});var n=o(96540);const s={},i=n.createContext(s);function a(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);

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.