1"use strict";(self.webpackChunkKatalon_Docs=self.webpackChunkKatalon_Docs||[]).push([[6911],{28453:(e,a,t)=>{t.d(a,{R:()=>d,x:()=>n});var s=t(96540);const c={},_=s.createContext(c);function d(e){const a=s.useContext(_);return s.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function n(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:d(e.components),s.createElement(_.Provider,{value:a},e.children)}},98125:(e,a,t)=>{t.r(a),t.d(a,{assets:()=>o,contentTitle:()=>r,default:()=>l,frontMatter:()=>n,metadata:()=>s,toc:()=>i});const s=JSON.parse('{"id":"keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-image-present","title":"[WebUI] Wait For Image Present","description":"Known limitation: The waitForImagePresent keyword may not function as expected in Safari due to browser-specific limitations in handling image objects. We recommend using other browsers like Chrome or Firefox for this image-based operation.","source":"@site/docs/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-image-present.md","sourceDirName":"keywords/keyword-description-in-katalon-studio/web-ui-keywords","slug":"/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-image-present","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-image-present","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1758935351000,"frontMatter":{"title":"[WebUI] Wait For Image Present"},"sidebar":"katalon-studio","previous":{"title":"[WebUI] Wait For Element Visible","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-element-visible"},"next":{"title":"[WebUI] Wait for jQuery Load","permalink":"/katalon-studio/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-wait-for-jquery-load"}}');var c=t(74848),_=t(28453),d=t(86025);const n={title:"[WebUI] Wait For Image Present"},r=void 0,o={},i=[{value:'<a class="anchor_top_offset"></a>Description',id:"description",level:2},{value:'<a class="anchor_top_offset"></a>Parameters',id:"parameters",level:2},{value:'<a class="anchor_top_offset"></a>Returns',id:"returns",level:2},{value:'<a class="anchor_top_offset"></a>Example',id:"example",level:2}];function f(e){const a={h2:"h2",...(0,_.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"shortdesc"}),"\n",(0,c.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"note note note_note",children:[(0,c.jsx)("span",{className:"note__title",children:"Known limitation:"})," ",(0,c.jsxs)("p",{className:"p",children:["The ",(0,c.jsx)("code",{className:"ph codeph",children:"waitForImagePresent"})," keyword may not function as expected in Safari due to browser-specific limitations in handling image objects. We recommend using other browsers like Chrome or Firefox for this image-based operation."]})]}),"\n",(0,c.jsxs)(a.h2,{id:"description",children:[(0,c.jsx)("a",{id:"id_0__id_1",class:"anchor_top_offset"}),"Description"]}),"\n",(0,c.jsx)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:"Wait for an image to be present on page."}),"\n",(0,c.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["Keyword name: ",(0,c.jsx)("code",{className:"ph codeph",children:"waitForImagePresent"})]}),"\n",(0,c.jsxs)(a.h2,{id:"parameters",children:[(0,c.jsx)("a",{id:"id_0__id_2",class:"anchor_top_offset"}),"Parameters"]}),"\n",(0,c.jsxs)("table",{xmlns:"http://www.w3.org/1999/xhtml",className:"table anchor_top_offset",id:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1",children:[(0,c.jsx)("caption",{}),(0,c.jsx)("thead",{className:"thead",children:(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1",children:"Parameter"}),(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2",children:"Parameter Type"}),(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__4ccf23f4
1-de5f-44d6-a8f4-4fba3e565ce1__entry__3",children:"Required"}),(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4",children:"Description"})]})}),(0,c.jsxs)("tbody",{className:"tbody",children:[(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"to"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"TestObject"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"Yes"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"Represents an image."})]}),(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"timeOutInSeconds"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"int"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"Yes"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"Maximum period of time (in seconds) that system will wait to return result."})]}),(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"flowControl"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"FailureHandling"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:"Optional"}),(0,c.jsxs)("td",{className:"entry",headers:"id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__1 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__2 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__3 id_0__4ccf23f4-de5f-44d6-a8f4-4fba3e565ce1__entry__4 ",children:["Specify ",(0,c.jsx)("a",{className:"xref j-external-link",href:"https://docs.katalon.com/katalon-studio/docs/failure-handling.html",target:"_blank",children:"failure handling"})," schema to determine whether the execution should be allowed to continue or stop."]})]})]})]}),"\n",(0,c.jsxs)(a.h2,{id:"returns",children:[(0,c.jsx)("a",{id:"id_0__id_3",class:"anchor_top_offset"}),"Returns"]}),"\n",(0,c.jsxs)("table",{xmlns:"http://www.w3.org/1999/xhtml",className:"table anchor_top_offset",id:"id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888",children:[(0,c.jsx)("caption",{}),(0,c.jsxs)("colgroup",{children:[(0,c.jsx)("col",{style:{width:"33.33333333333333%"}}),(0,c.jsx)("col",{style:{width:"66.66666666666666%"}})]}),(0,c.jsx)("thead",{className:"thead",children:(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__1",children:"Parameter Type"}),(0,c.jsx)("th",{className:"entry anchor_top_offset",id:"id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__2",children:"Description"})]})}),(0,c.jsx)("tbody",{className:"tbody",children:(0,c.jsxs)("tr",{className:!0,children:[(0,c.jsx)("td",{className:"entry",headers:"id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__1 id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__2 ",children:"Boolean"}),(0,c.jsx)("td",{className:"entry",headers:"id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__1 id_0__2abf1dc5-9c8a-4ddd-9e81-5f5746c1e888__entry__2 ",children:(0,c.jsxs)("ul",{className:"ul",children:[(0,c.jsxs)("li",{className:"li",children:[(0,c.jsx)("code",{className:"ph codeph",children:"true"})," if the image is presented."]}),(0,c.jsxs)("li",{className:"li",children:[(0,c.jsx)("code",{className:"ph codeph",children:"false"})," if the image is not presented."]})]})})]})})]}),"\n",(0,c.jsxs)(a.h2,{id:"example",children:[(0,c.jsx)("a",{id:"id_0__id_4",class:"anchor_top_offset"}),"Example"]}),"\n",(0,c.jsxs)("p",{xmlns:"http://www.w3.org/1999/xhtml",className:"p",children:["You want to wait for ",(0,c.jsx)("code",{className:"ph codeph",children:"img_KatalonLogo"})," to be present on page:"]}),"\n",(0,c.jsx)("pre",{xmlns:"http://www.w3.org/1999/xhtml",className:"pre codeblock",children:(0,c.jsxs)("code",{children:["import static com.kms.katalon.core.checkpoint.CheckpointFactory.findC
1heckpoint","\n","import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase","\n","import static com.kms.katalon.core.testdata.TestDataFactory.findTestData","\n","import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject","\n","import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint","\n","import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory","\n","import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords","\n","import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile","\n","import com.kms.katalon.core.model.FailureHandling as FailureHandling","\n","import com.kms.katalon.core.testcase.TestCase as TestCase","\n","import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory","\n","import com.kms.katalon.core.testdata.TestData as TestData","\n","import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory","\n","import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository","\n","import com.kms.katalon.core.testobject.TestObject as TestObject","\n","import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords","\n","import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS","\n","import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords","\n","import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI","\n","import internal.GlobalVariable as GlobalVariable","\n","\n","'Open browser and navigate to a site that contains an image'","\n","WebUI.openBrowser(GlobalVariable.G_SiteURL)","\n","\n","'Wait for the image to be present'","\n","WebUI.waitForImagePresent(findTestObject('img_KatalonLogo'))","\n","\n","'Close browser'","\n","WebUI.closeBrowser()","\n","\n"]})}),"\n",(0,c.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"note note note_note",children:[(0,c.jsx)("span",{className:"note__title",children:"Note:"})," ",(0,c.jsx)("p",{className:"p",children:"The test object needs to define a source image from the local machine for Katalon Studio to use it for verification:"}),(0,c.jsxs)("p",{className:"p",children:[(0,c.jsx)("img",{className:"image",src:(0,d.Ay)("https://github.com/katalon-studio/docs-images/raw/master/katalon-studio/docs/webui-wait-for-image-present/define_image.jpg")}),(0,c.jsx)("br",{}),(0,c.jsx)("br",{})]})]})]})}function l(e={}){const{wrapper:a}={...(0,_.R)(),...e.components};return a?(0,c.jsx)(a,{...e,children:(0,c.jsx)(f,{...e})}):f(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.