Click Image on a specific window?

Is there any way to use Click Image on a specific window?

In my software application, there are multiple, very similar looking windows. Each window has a different name on the top, but the content and structure of each of them are very similar. (Say, window A, window B, and window C).

There is a button that is common to all windows, and I want UiPath to click on it on Window A. Unfortunately, regular click activity doesn’t work because Indicate element on window somehow covers the entire area and I cannot pick up the specific button element. So I am using Click Image, but when I tried it, it clicks on the same button image of window B!

I am using this Click Image activity inside Attach Window attached to Window A. Why does it click on the image of Window B?
Is there any way to specify the window within which I want UiPath to find the image?

1 Like

Hi

It’s been long time…
Hope you are doing good

In attach window itself we can include the attributes along the selector that specifies window A
Kindly include more specific attributes in attach window and and include click image activity in that with simulate click enabled

Cheers @tomato25

I dont think that should happen unless your selector for the attach window is not right…

The selector for the Attach Window should be correct, because when I do Highlight, it does highlight window A, which is correct. Also, the selector is like the following:

< wnd app=’< application name.exe>’ cls=‘Tf_Main’ title=’ < Application Name> ’ />
< wnd aaname=‘Application’ cls=‘MDIClient’/>
< wnd cls=’ < window name here>’ title=‘Window A*’ />

As you can see, the title attribute specifically says Window A.
Window B and C has their own name (i,e, title=‘Window B’, and title=‘Window C’).

And I am using Click Image inside this Attach Window. But, it still clicks on the image from Window B!

1 Like

Awesome
Let’s try this
Use ACTIVATE activity where pass the same selector for window A as input for selector as a string

Now get that to a situation where we want to click when multiple windows are opened
And let’s see whether this activity brings
That window to foreground and if that happens then we can now use Click image activity to click upon the image we want

Cheers @tomato25

1 Like

Actually bringing the window to the top of the screen won’t help.

I already tried that by clicking on a random image unique to Window A, and this brought Window A to the top of the screen.

However, when the program runs and does Click Image, it brings Window B up to the front, and clicks the button image on there! :frowning:

what is the selector for the click image? make sure is is a partial one, if it is inside the right attach window and selector is partial and still this do not work, we need to escalate to an uipath person, cause this could be a bug…

I don’t think there is a selector for Click Image.
Well, there is a property “Selector”, but it just says “Enter a VB expression” and I have it empty.

then you know why you have bad results :wink:

I actually don’t know :frowning:
In my understanding, selector is like those HTML tags, and a VB expression is something else.

what do you mean you dont know selectors? if you dont fill that, then you image will be searched everywhere in the screen…

Normally, if you use an activity such as Click inside Attach Window activity, it autogenerate the partial selector for the Click, right?

So, I was thinking the same rule will apply to other activities like Click Image.
Since I am using Attach Window, which has the full selector, and I am using Click Image inside, I thought it will only search for the image inside that Attach Window.

But since this is not doing what I want it to do, does that mean, some activities like Click Image won’t auto-generate selectors, and you have to type it on your own?

click image does generate the selector, when you use that link “indicate image on screen”…

It seems like it doesn’t always, at least in my case.

Unlike regular Click activity, which lets you indicate an element and highlights the element in blue, Click Image activity will make you select the range of the image you want to pick up. It doesn’t highlight any element on the screen. Instead you have to decide which image to use, and then you have to drag the mouse down-right-wards to create a rectangular shaped image.

This will not generate the selector.