When I close and reopen the window I'm automating the selector can no longer be found. When I reindicate an identical selector is generated that can now be found

Hi

I am automating a WinForms application. I have come across an issue now multiple times where I indicate an element on the screen for the Type Into activity. It validates and works ok. However, if I close and reopen the WinForms application, the selector can no longer be found.

There are no dynamic identifiers being used in the selector

Example:

Open Application
Select Type Into activity
Select Indicate On Screen
The following selector is generated:

<wnd app='cumisforms.exe' ctrlname='MainForm' />
<wnd ctrlname='LoanApplication' />
<wnd ctrlname='tpcMain' />
<wnd ctrlname='tbpLoanApp' />
<wnd ctrlname='grpAppDetails' />
<wnd aaname='Amount requested' cls='WindowsForms10.Window.*' />
<wnd ctrlname='cboLoanPurpose' />
<ctrl role='editable text' />

Run workflow
Process runs successfully

Close application and reopen
Run process again
Process fails
Reindicate element
An identical selector is generated

<wnd app='cumisforms.exe' ctrlname='MainForm' />
<wnd ctrlname='LoanApplication' />
<wnd ctrlname='tpcMain' />
<wnd ctrlname='tbpLoanApp' />
<wnd ctrlname='grpAppDetails' />
<wnd aaname='Amount requested' cls='WindowsForms10.Window.*' />
<wnd ctrlname='cboLoanPurpose' />
<ctrl role='editable text' />

Run the process again and it works
Rinse and repeat

Selector after being Indicated initially

Selector after closing the application and reopening

Selector after reindicating (identical but now Validating)

Hi @m.finnegan !
I think that the trick relies on the attribute “aastate”
Before clicking the element you want, first use get attribute on your wanted element; if the aastate is “invisible, focusable” then you can click, otehrwise it has to loop on get attribute until the attribute aastate is what you look for

1 Like

Hi @m.finnegan

What is your version of Studio and UIAutomation activity package?

Does the same happen for a sample app, like a Notepad?

Hi I think Hiba_B has cracked it. Apologies for mislabelling as a bug. Thanks all

Awesome, no worries! :slight_smile:

That’s great !!
Don’t forget to close your topic by marking it as solved so we can focus on unresolved topics ^^