Active window (program) unexpectedly loses focus

Hi Everyone,

General question for Windows users although in my case I’m seeing the issue w Windows Server 2019.

The program suddenly “loses focus” (it’s no longer the active window / program); an example visual indication is that in the Windows taskbar, the icon no longer has a pale gray “highlight”. Eggplant went to hit Enter and of course the program didn’t receive that input, and didn’t respond accordingly.

I’m curious if anyone else has encountered this problem and if so, how you’re managing it.

If anyone knows of any Windows tricks, knicking it at the source seems like the best solution to me. For example, perhaps forcing the target window to remain active until you specify otherwise (not sure if there’s a way to do this natively w Windows, but it seems there are 3rd party apps)

Accounting for this in Eggplant script (either proactively, by clicking the window or popup header before EVERY input, or reactively using Catch statements and repeat loops) strikes me as impractical.

Has anyone experimented with Eggplant’s “Omega 13” functionality? If going with an Eggplant solution, maybe it would be a good fit?

Thanks very much for your time! : )
Dan

*Side question for Eggplant staff: I’m getting an error trying to post screenshots (“You can’t embed images”). Is there still some method to post images to the forums? Thank you!

Hi Dan,
This happens to me most frequently immediately after I connect to a SUT. I will resolve this by creating a “zero state” script that waits 60 seconds or so to finish loading my Windows profile before I access the application under test.
As for images, are you trying to paste them into the editor window or are you clicking on the icon in the editor to add your image?
Thanks,
Dave

Thanks Dave. In my case, the ‘lost focus’ occurred about 5 minutes after connecting to the SUT (connection begins w a short ‘wait’ and then a couple minutes of safety checks, such as launching Citrix’s Connection Center). I ended up adding a contingency for the specific fail point (basically, if you hit returnKey and don’t see text for next screen, then Eggplant clicks the app’s window header, and repeats). Fortunately, it’s worked like a charm in the 2 wks since, so I don’t think I need to worry about rolling out some universal “input safety check” / Omega-13-level solution. If you have any suggestions re: how to account for lost focus mid-workflow (such as repeat loops vs. Try / Catch, etc.) please let me know.

Re: images, I tried clicking the icon to add images.

Thanks for your time!
Dan