How to bring window to focus

I open an application, and the window isn’t selected. when I click on it, the window border turns blue, because it now has focus. What is a good way to bring a window to focus, besides doing a click activity? is there a different activity, or can i write code to do that, like window.setFocus() or something? When I attach the window, it doesn’t seem to be able to find it because it’s not in focus.

Then when I try to click run it doesn’t find the run button.

Hello!

Have you tried to use “Maximize” activity? :slight_smile:

image

Regards,

1 Like

Okay, so It maximizes the window, but it’s just a little security warning dialogue. It says, We can’t verify who created this file. Are you sure you want to run this file?
And I just want to click run. When I maximize it, the run button is all the way up in the corner because there really isn’t alot of information to maximize in the first place.

Also there are no other windows open just that one. So I don’t think maximizing the window will help. I don’t know why it won’t hit the run button really…

1 Like

If you use an Attach Window, then place a Window variable in the Output property, you can use that variable in any number of Window activities:
image

However, you shouldn’t really need to gain focus to the window for most Click and TypeInto interactions. There could be an issue with the Selector too, if it is failing to click a button. But it’s hard to say without actually working with your environment. Maybe if you provide other details or screenshots we can help further.

Regards.

So It doesn’t even find the window I try to attach the window, and it doesn’t find it. I’ve modified the selector in every way possible starting from the full selector. I think it’s because it’s a warning dialogue box, but it says that the application is “explorer.exe” and then it gives the title=‘Open Application - Security warning’ I’m just puzzled and confused. I’m not sure how else to get it to attach to the dialogue box, or at least just click run.

snip

Can it find the window from UI Explorer?
image

And verify that the selector in UI Explorer matches what you have in the activity.

Also, I did a search on what security warning you are talking about. You might be able to disable this as part of your environment settings, as there are many settings that can suppress these various dialogue popups.

here is some info:

But if not, I’m assuming that clicking the Run should work on that one (without attaching to the window first)

1 Like

I wish I could, but this is actually on a server at work, and they’re probably not going to do that. too much red tape in the way. I did open it in UiExplorer. I took the full selector from there. It coudn’t find it, so I tried removing some of the attributes one at a time. Still no luck. I just don’t get it. It’s the only window open on the desktop. How hard could it be to find!

Have you tried adding the Java extension and then trying to select?
I have used that and now UiExplorer is able to identify the fields.

1 Like

I installed the Java extension. Still no luck. It has the same selectors too. I thought they were supposed to be different or something. What I think it could be possibly is that the element that pops up in my work flow is different than the one I’m selecting from.

So when It doesn’t find the window. I push stop, and the dialogue window disappears.So to get the selector, I have to do a run window, and type the file path there to bring it back up again. I thought there was an activity that I could use to select something while it’s running… I don’t remember what it’s called though. :confused:

you can record your process in a different sequence and then use that bit where the popup happens and you close it

What I ended up doing, was just pausing the automation, then using UIExplorer, to get the selector. Then Once I had the selector everything worked fine. So pushing pause, getting the selector. That’s what worked.

4 Likes