Selector not working when there is more than one Window from same process

Hello,

when I have two instances of notepad running and I want to select the window with some special text in it (“test content”) the selector fails.

so I want to select the textbox with the content. When I browse to the element in the UiExplorer I can find it.

Why does the following selector not work until I close the empty notepad window?

wnd app=‘notepad.exe’
ctrl name=‘Text-Editor’ role=‘editable text’ text=‘test content’

thanks in advance

Your selector seems like it would be valid for either. Is it selecting the blank notebook? What activity are you using?

it should only be valid for one window cause of:
text=‘test content’

in uiExplorer the validation fails red. I use the “On Element Appear” Activity followed by “Highlite”.
But the Highlite is never executed.

I can’t recreate the problem. Does the selector validation work before you start the automation? Are you typing “test content” into your selector or is UiPath creating that for you?

@sjr6728 no its not valid before automation. If i copy the text from one notepad to the oder its getting valid.
I edited the selector manually.

@sjr6728 sometimes it works sometimes don´t. If you want to recreate it do following:

insert the “on element appears” into a endless while loop with condition “true”. Set the attribute “Repeat forever” of the “on element appears” to false.
If you start the skript and copy the text from one notepad to the other it will only work in one of them.

thanks for your efford my man

I messed around for a while. It appears to be a UiPath flaw that if it matches the top level of the selector hierarchy that it locks onto that window or process. I have a few things I want to play with to check this out further but idk when I’ll get around to it. I wanted to try using only a partial selector of the lowest tier of the selector and then qualify the results. I was also thinking if you could determine how many open windows there currently were that you could throw some hot keys in the loop and alt+tab * xAmount of windows to give each window a turn at being on top. Or following up each try with minimizing the window that it had found. Let me know how things turn out. I’ll give you an update if I find anything worth sharing.

1 Like

@sjr6728 yeah i think thats the issue, in my opptinion this is a bug by uipath selectors.
i tried the same scenario with the “find element” activity so its a selector problem.

I don´t want a messy workaround, so I will claim my 60 days enterprise trail soon then i will ask the same question to the uipath support.

Have you gotten any answer back from UiPath support for Enterprise? I am running into the same issue, and I would do the same as you, but the bureaucratic powers that be at my company won’t allow me to go straight to UiPath support.