Image doctor fails to start with imagefound function helper

I have a script as a helper that evaluates if an image is found, it logs and clicks foundImageLocation(). Otherwise it logs the failure and returns.

I am finding that when imagefound fails, it is not popping open Image Doctor (verified Doctor is set to > Manual Doctor).

Is the problem that the imagefound function does not trigger Image Doctor like WaitFor does, or that my code is in a helper script?

See below for what we’re doing.

Main script:

IfThenElse 30.0, "Scenario_1/myImage", Click

In the Helper script (IfThenElse.script) the code is:

Params ImageTime, ImageName, Action 

if imagefound (ImageTime, ImageName) 
	log "Expected image was found, so clicking: " & ImageName 
	do Action && "foundImageLocation()"
	LogError "Expected Image Not Found: " & ImageName
end if

I found that if I add a Waitfor call in my else case, I can trigger the image doctor as a workaround.

Any advice on the workaround we’re using to get Image Doctor to come up? This is extremely helpful when our UI’s change and we have to go through and replace many images.

Alex Barnett
barnetta - at -

Yes, the issue is that ImageFound doesn’t trigger the Image Doctor – the Image Doctor is triggered by the exception generated by a failed command. Not finding an image referenced by ImageFound is not an error – not finding the image may be the desired outcome. Not finding an image referenced by WaitFor is an error, so it triggers the Image Doctor.

Excellent Matt, thanks for the reply! We have a workaround I think that suits our needs when a large number of images change and we have to doctor them up.