cancel
Showing results for 
Search instead for 
Did you mean: 

Proces only works when desktop is watched

Jens_OleKnudse1
Level 3
Hi BP community

On my recent proces, I've run into the problem, that the proces will run fine on my own computer and on one of the servers, when I view the server with SCCM, but not when I haven't connected to the server via SCCM in a short while. I've tried it on 3 different servers and the pattern is clear. It runs when watched, but not when I'm not watching. We've run several other processes on the same servers, so it can't be an issue with the server "turning of the desktop", running a screen saver or something like that.

I'm using CMD to start the windows page for setting default programs as shown in an attached file. I then attach to this proces. Both steps work without any issue. I then check if the window exists via a wait stage, which is the stage that fails, when the desktop isn't watched. I've attached a view of the application modeller for the window.

I've tried restarting the computers, I've tried respying the window (both from my own computer and on the server), I've tried tweaking the spied elements to include others and not include some of those shown in the screenshot.

Anyone got any idea as to why a proces like this wouldn't work when not watched?
2 REPLIES 2

Jens_OleKnudse1
Level 3

Just a quick update:

I tried it on yet another server and the proces would not run while watched. But it would run when I stepped through it. So It couldn't find the window, when run from the control room, but could when stepped through. It's not a time issue as it found the window in less than a second and the wait stage is 20 seconds. When I ran it from the control room, I could see the page being opened and Blueprism attached to the windows proces without issues, but it couldn't find the window during the wait stage.

John__Carter
Staff
Staff
Hi Jens I'd investigate the point between the cmd and the attempt to attach. As you know, by launching the app via the cmd line the attach is not automatic, and you have to do it yourself. However, if you try too early, before the target app is ready, then the attach attempt will fail. A workaround is to put the attach stage in a block and use recover/resume to make multiple attempts to attach. Put a small pause between each attempt and use a counter to avoid infinite recover/resume fun.