1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[8584],{28453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var s=n(96540);const o={},i=s.createContext(o);function r(e){const t=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(i.Provider,{value:t},e.children)}},84644:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>l});const s=JSON.parse('{"id":"keywords/keyword-description-in-katalon-studio/windows-keywords/windows-take-element-screenshot","title":"[Windows] Take Element Screenshot","description":"Description","source":"@site/docs/katalon-studio/keywords/keyword-description-in-katalon-studio/windows-keywords/windows-take-element-screenshot.md","sourceDirName":"keywords/keyword-description-in-katalon-studio/windows-keywords","slug":"/keywords/keyword-description-in-katalon-studio/windows-keywords/windows-take-element-screenshot","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/windows-keywords/windows-take-element-screenshot","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1754077823000,"frontMatter":{"title":"[Windows] Take Element Screenshot"},"sidebar":"katalon-studio","previous":{"title":"[Windows] Switch to Window Title","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/windows-keywords/windows-switch-to-window-title"},"next":{"title":"[Windows] Take Screenshot","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/windows-keywords/windows-take-screenshot"}}');var o=n(74848),i=n(28453);const r={title:"[Windows] Take Element Screenshot"},d=void 0,a={},l=[{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",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"description",children:"Description"}),"\n",(0,o.jsx)(t.p,{children:"Captures a screenshot of a specific UI element in the currently active Windows application."}),"\n",(0,o.jsxs)(t.p,{children:["Keyword name: ",(0,o.jsx)(t.code,{children:"Windows.takeElementScreenshot"})]}),"\n",(0,o.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Parameter"}),(0,o.jsx)(t.th,{children:"Parameter Type"}),(0,o.jsx)(t.th,{children:"Mandatory"}),(0,o.jsx)(t.th,{children:"Description"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"fileName"}),(0,o.jsx)(t.td,{children:"String"}),(0,o.jsx)(t.td,{children:"Optional"}),(0,o.jsx)(t.td,{children:"Represents a path to save the image file. It can be either an absolute or a relative path."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"to"}),(0,o.jsx)(t.td,{children:"TestObject"}),(0,o.jsx)(t.td,{children:"Yes"}),(0,o.jsx)(t.td,{children:"Represents the Windows UI element to capture."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"flowControl"}),(0,o.jsx)(t.td,{children:"FailureHandling"}),(0,o.jsx)(t.td,{children:"Optional"}),(0,o.jsxs)(t.td,{children:["Specify ",(0,o.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,o.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,o.jsxs)(t.p,{children:["You want to take a screenshot of a specific UI element (",(0,o.jsx)(t.code,{children:"Edit_PasswordBox"}),")) in a Windows desktop application:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-jsx",children:'Windows.takeElementScreenshot("C:\\temp\\element_screenshot_02.png", findWindowsObject("Object Repository/WpfApplication/Simple_Controls/Edit_PasswordBox"), STOP_ON_FAILURE)\n'})})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.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.