cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alert when object is found ?

gilgi
Advisor

Hi, 

Is there a possibility to trigger an alert only when a certain object is found in the screen capture ? for example, an application which is showing images from street cameras would need an alert only when the screen will show something like "no image found" object.

Gil. 

2 REPLIES 2

erick2
Inactive

Hi Gil,

Yes, I believe this is possible the secret is how you code it. Remember, there is no right way it all comes down to coding preferences. This what i came up with without having an app to test against. 

 

EXAMPLE 1: with one camera

' Code to navigate to Camera Image
StartTrace "Wait_for_image_in_Camera" ' START vvvvvvvvvvvvv

' If the image is not what you are waiting for it will mark the transaction as a failure
WaitForImage "Object where to look for the image", "Expected Image from Camera"
StopTimerAndTrace "Wait_for_image_in_Camera" ' END ^^^^^^^^^^^^^^^

------------------------------- Example 1 ends ---------------------------------------------------
 


EXAMPLE 2: with more than one camera

'If more than One Camera

'Code to navigate to Camera Image
StartTrace "Wait_for_image_in_Camera" ' START vvvvvvvvvvvvv

If WaitForAnyImages("Object where to look for the image", "Expected Error Image") = 1 Then
MarkTransUnavailable "Wait_for_image_in_Camera"
End If

WaitForImage "Object where to look for the image", "Expected Image from Camera"

StopTimerAndTrace "Wait_for_image_in_Camera" ' END ^^^^^^^^^^^^^^^

------------------------------- Example 2 ends ---------------------------------------------------


All you have to do after you create your script with your transaction is alert on the transaction or application depending what you want. 


I hope this helps you to get you started. 

Regards, 

Erick Z.

gilgi
Advisor

Erick, 

 

Thanks, but If I'm not mistaking it will do the opposite of what I want. I only want to alert only when the image is found and not when it's not.

Am I misunderstanding you ? 

Gil.