1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[5496],{28453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>s});var o=n(96540);const i={},l=o.createContext(i);function r(e){const t=o.useContext(l);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(l.Provider,{value:t},e.children)}},93592:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-enhanced-scroll-to-text","title":"[Mobile] Enhanced Scroll To Text","description":"Description","source":"@site/docs/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-enhanced-scroll-to-text.md","sourceDirName":"keywords/keyword-description-in-katalon-studio/mobile-keywords","slug":"/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-enhanced-scroll-to-text","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-enhanced-scroll-to-text","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1755792510000,"frontMatter":{},"sidebar":"katalon-studio","previous":{"title":"[Mobile] Double Tap","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-double-tap"},"next":{"title":"[Mobile] Execute Mobile Command","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-execute-mobile-command"}}');var i=n(74848),l=n(28453);const r={},s="[Mobile] Enhanced Scroll To Text",d={},a=[{value:"Description",id:"description",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Example",id:"example",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"mobile-enhanced-scroll-to-text",children:"[Mobile] Enhanced Scroll To Text"})}),"\n",(0,i.jsx)(t.h2,{id:"description",children:"Description"}),"\n",(0,i.jsx)(t.p,{children:"Scroll to the given text inside a scrollable container represented by a Test Object."}),"\n",(0,i.jsxs)(t.p,{children:["Keyword name: ",(0,i.jsx)(t.code,{children:"Mobile.enhancedScrollToText"})]}),"\n",(0,i.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameters"}),(0,i.jsx)(t.th,{children:"Parameter Type"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Description"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"to"}),(0,i.jsx)(t.td,{children:"TestObject"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{children:"The scrollable container in which the text should be found"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"text"}),(0,i.jsx)(t.td,{children:"String"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{children:"Text of the element to scroll to."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"timeout"}),(0,i.jsx)(t.td,{children:"Integer"}),(0,i.jsx)(t.td,{children:"Optional"}),(0,i.jsx)(t.td,{children:"Maximum time (in seconds) to perform the scroll action before throwing an exception."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"flowControl"}),(0,i.jsx)(t.td,{children:"FailureHandling"}),(0,i.jsx)(t.td,{children:"Optional"}),(0,i.jsxs)(t.td,{children:["Specify ",(0,i.jsx)(t.a,{href:"/katalon-studio/maintain-tests/configure-failure-handling-settings-in-katalon-studio",children:"failure handling"})," schema to determine whether the execution should be allowed to continue or stop."]})]})]})]}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,i.jsxs)(t.p,{children:["Scroll to the element which the displayed text is ",(0,i.jsx)(t.strong,{children:"Settings"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-jsx",children:"import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject\nimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile\nimport com.kms.katalon.core.model.FailureHandling as FailureHandling\n\n// Start the application\nMobile.startApplication('path/to/your/app.apk', false)\n\n// Define the scrollable container (e.g., a list or scroll view)\nTestObject scrollableList = findTestObject('Object Repository/Mobile/Scrollable_List')\n\n// Scroll to the target text inside the container\nMobile.enhancedScrollToText(\n scrollableList, // The scrollable container\n 'Settings', // The text to find and scroll to\n 20, // Timeout (in seconds)\n FailureHandling.STOP_ON_FAILURE // Failure handling option\n)\n\n// (Optional) Tap on the found element after scrolling\nMobile.tap(findTestObject('Object Repository/Mobile/Text_Settings'), 10)\n\n// Close the application\nMobile.closeApplication()\n\n"})})]})}function h(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(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.