1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[3973],{28453:(e,t,o)=>{o.d(t,{R:()=>s,x:()=>r});var i=o(96540);const n={},l=i.createContext(n);function s(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:s(e.components),i.createElement(l.Provider,{value:t},e.children)}},52089:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>m,frontMatter:()=>s,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-scroll-to-text-horizontal","title":"[Mobile] Scroll To Text Horizontal","description":"Description","source":"@site/docs/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-scroll-to-text-horizontal.md","sourceDirName":"keywords/keyword-description-in-katalon-studio/mobile-keywords","slug":"/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-scroll-to-text-horizontal","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-scroll-to-text-horizontal","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1769512237000,"frontMatter":{"title":"[Mobile] Scroll To Text Horizontal"},"sidebar":"katalon-studio","previous":{"title":"[Mobile] Scroll To Text","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-scroll-to-text"},"next":{"title":"[Mobile] Send Keys","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/mobile-keywords/mobile-send-keys"}}');var n=o(74848),l=o(28453);const s={title:"[Mobile] Scroll To Text Horizontal"},r=void 0,a={},d=[{value:"Description",id:"description",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Example",id:"example",level:2}];function c(e){const t={code:"code",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h2,{id:"description",children:"Description"}),"\n",(0,n.jsx)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:"Scroll horizontally (left/right) to an element which contains the given text."}),"\n",(0,n.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["Keyword name: ",(0,n.jsx)("code",{className:"ph codeph",children:"Mobile.scrollToText"})]}),"\n",(0,n.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Parameters"}),(0,n.jsx)(t.th,{children:"Parameter Type"}),(0,n.jsx)(t.th,{children:"Required"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"text"}),(0,n.jsx)(t.td,{children:"String"}),(0,n.jsx)(t.td,{children:"Yes"}),(0,n.jsx)(t.td,{children:"Text of the element to scroll to"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:"timeout"}),(0,n.jsx)(t.td,{children:"int"}),(0,n.jsx)(t.td,{children:"Optional"}),(0,n.jsx)(t.td,{children:"Timeout in seconds"})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,n.jsxs)(t.p,{children:["Scroll to the element which the displayed text is ",(0,n.jsx)(t.code,{children:"Xfermodes"}),", and stop scrolling after timeout of 5 seconds:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-jsx",children:"import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase\nimport static com.kms.katalon.core.testdata.TestDataFactory.findTestData\nimport static com.kms.katalon.core.testobject.ObjectRepository.findTestObject\nimport internal.GlobalVariable as GlobalVariable\nimport com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration\nimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile\nimport com.kms.katalon.core.util.internal.PathUtil as PathUtil\n\n//'Start application on current selected android's device'\nMobile.startApplication(GlobalVariable.G_AndroidApp, false)\n\nMobile.tap(findTestObject('Application/android.widget.TextView - Graphics'), GlobalVariable.G_Timeout)\n\n//'Scroll to element which displayed text is Xfermodes, timeout set to 5 seconds'\nMobile.scrollToTextHorizontal('Xfermodes', 5)\n\n//'Get item's label'\ndef itemText = Mobile.getText(findTestObject('Application/Graphics/android.widget.TextView - Xfermodes'), GlobalVariable.G_Timeout)\n\n//'Verify if item's label is equal to \"Xfermodes\"'\nM
1obile.verifyEqual(itemText, 'Xfermodes')\n\n//'Close application on current selected android's device'\nMobile.closeApplication()\n"})})]})}function m(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.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.