Skip to main content

CV-Detect-Element

Command Description

Determine if a given element exists after conducting UI Detection

Command Prototype

bRet = UiDetection.Exists(objUiElement,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTrueexpression{}Select the recognized target of Computer Vision and the feature values of the anchor element
bContinueOnErrorNonebooleanNoneSpecify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value
iDelayAfterNonenumber200Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber300The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds

return

bRet,The variable used to save the output of the command.

Demo

TracePrint("--------------------------After intelligent identification, judge the existence of the element--------------- ------------") 
//-------------------------------------------------------------------------------
//[Remarks] Determine whether the element exists after intelligent recognition. (This command must be used together with the intelligent recognition screen range)
//Input parameter 1:
// objUiElement--Identifies the target. Note: The eigenvalues ​​of the selected intelligently recognized target element and anchor element
// iTimeOut--timeout time (milliseconds). Note: The amount of time, in milliseconds, to wait for the command to retry the run before the lookup target throws an exception. Default 30000 (30 seconds)
// optionArgs--Optional parameters. Note: This parameter is a number of optional parameters, including error continuation execution, post-execution delay, and pre-execution delay
//out parameters:
// bRet--The variable to which the output of the function call is saved.
//Command prototype: UiDetection.Hover(objUiElement, iTimeout, optionArgs)
#icon("@res:ad0d4140-7f24-11ec-ab08-1d7b5faf0fee.png")
bRet = UiDetection.Exists({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"Click - Feishu Cloud Documents - Google Chrome","app":"chrome "}],"cv_engine_version":1,"cv_region":{"x":0,"y":0,"width":0,"height":0},"cv_descriptor":{"anchors":[ {"cls_type":100,"height":33,"text":"command description","width":99,"x":586,"y":357}],"confidence":0.800000011920929,"cv_handle ":"\"2b3223b0-7f20-11ec-ab08-1d7b5faf0fee\"","match_version":1,"target":{"cls_type":100,"height":25,"text":"click after intelligent recognition element","width":153,"x":589,"y":400}}},{"bContinueOnError":false,"iDelayAfter":200,"iDelayBefore":300})
TracePrint(bRet)