1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[5381],{28453:(e,t,o)=>{o.d(t,{R:()=>i,x:()=>a});var r=o(96540);const s={},n=r.createContext(s);function i(e){const t=r.useContext(n);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(n.Provider,{value:t},e.children)}},76651:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>i,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-scroll-from-viewport-offset","title":"[WebUI] Scroll From Viewport Offset","description":"This keyword is available from Katalon Studio version\xa010.0.0+.","source":"@site/docs/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-scroll-from-viewport-offset.md","sourceDirName":"keywords/keyword-description-in-katalon-studio/web-ui-keywords","slug":"/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-scroll-from-viewport-offset","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-scroll-from-viewport-offset","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1750151284000,"frontMatter":{"title":"[WebUI] Scroll From Viewport Offset"},"sidebar":"katalon-studio","previous":{"title":"[WebUI] Right-click Offset","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-right-click-offset"},"next":{"title":"[WebUI] Scroll To Element","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-scroll-to-element"}}');var s=o(74848),n=o(28453);const i={title:"[WebUI] Scroll From Viewport Offset"},a=void 0,l={},c=[{value:"Description",id:"description",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Example",id:"example",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,n.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.admonition,{title:"Prerequisites",type:"caution",children:(0,s.jsxs)(t.p,{children:["This keyword is available from Katalon Studio version\xa0",(0,s.jsx)(t.strong,{children:"10.0.0+"}),"."]})}),"\n",(0,s.jsx)(t.h2,{id:"description",children:"Description"}),"\n",(0,s.jsx)(t.p,{children:"Scroll from a position within the current viewport with a given offset(x, y), deltaX, and deltaY."}),"\n",(0,s.jsx)(t.p,{children:"If the offset from the upper left corner of the viewport falls outside of the screen, it will result in an exception."}),"\n",(0,s.jsxs)(t.p,{children:["Keyword name:\xa0",(0,s.jsx)(t.code,{children:"scrollFromViewportOffset"})]}),"\n",(0,s.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:(0,s.jsx)(t.strong,{children:"Parameter"})}),(0,s.jsx)(t.th,{children:(0,s.jsx)(t.strong,{children:"Parameter Type"})}),(0,s.jsx)(t.th,{children:(0,s.jsx)(t.strong,{children:"Required"})}),(0,s.jsx)(t.th,{children:(0,s.jsx)(t.strong,{children:"Description"})})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"viewportOffsetX"}),(0,s.jsx)(t.td,{children:"int"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"Specify the x offset value of the current viewport to start scrolling from. Negative values represent left."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"viewportOffsetY"}),(0,s.jsx)(t.td,{children:"int"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"Specify the y offset value of the current viewport to start scrolling from. Negative values represent up."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"deltaX"}),(0,s.jsx)(t.td,{children:"int"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"Specify the delta x value for how much to scroll in the right direction. Negative values represent left."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"deltaY"}),(0,s.jsx)(t.td,{children:"int"}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"Specify the delta y value for how much to scroll in the down direction. Negative values represent up."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"flowControl"}),(0,s.jsx)(t.td,{children:"FailureHandling"}),(0,s.jsx)(t.td,{children:"Optional"}),(0,s.jsxs)(t.td,{children:["Specify\xa0",(0,s.jsx)(t.a,{href:"https://docs.katalon.com/katalon-studio/maintain-tests/configure-failure-handling-settings-in-katalon-studio",children:"failure handling"}),"\xa0schema to determine whether the execution should be allowed to continue or stop."]})]})]})]}),"\n",(0,s.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(t.p,{children:"You want to scroll from an offset of (50, 60) and scroll by (100, 150):"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-jsx",children:"import static com.kms.katalon.core.checkpoint.CheckpointFactory.findC
1heckpoint\nimport 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 com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint\nimport com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory\nimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords\nimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile\nimport com.kms.katalon.core.model.FailureHandling as FailureHandling\nimport com.kms.katalon.core.testcase.TestCase as TestCase\nimport com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory\nimport com.kms.katalon.core.testdata.TestData as TestData\nimport com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory\nimport com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository\nimport com.kms.katalon.core.testobject.TestObject as TestObject\nimport com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords\nimport com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS\nimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords\nimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI\nimport internal.GlobalVariable as GlobalVariable\n\n'Open browser and navigate to website katalon.com'\nWebUI.openBrowser('https://www.katalon.com/')\n\n'Scroll from the offset (50, 60) by (100, 150)'\nWebUI.scrollFromViewportOffset(50, 60, 100, 150)\n\n'Close browser'\nWebUI.closeBrowser()\n"})})]})}function m(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(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.