Welcome, Andrey.
'If logic' might well be applicable in your case.
As a simple sample - a VBScript example of the loop I mentioned in my post:
iTimeout = Project.Variables.pvtPageTimeout ' e.g. 30000 to wait no more than 30sec
iStopTime = Win32API.GetTickCount() + iTimeout
' Wait for the element to appear
strMsg = aqString.Format("Waiting for the '%s' element to load...", strValue)
Do
Call aqUtils.Delay(500, strMsg)
' Call PageCheckForException()
Set obj = FindChildNodeXPath(ObjectOnPage, strElement, strAttribute, strAttrValue, strValue)
Loop Until obj.Exists Or (Win32API.GetTickCount() > iStopTime)