Can't find element after application launch, but everything works if application already launched

Hi all,

*Using Studio v2021.10

I’m working with a Windows application where I have a sequence that has the following steps;

-Use Application
-Find Element
-Click Element

If the application is already launched (either manually, or by a previous run through studio) then the find/click will work perfectly.
If the application is not yet instantiated, then the Find Element will fail every time.
I have played around with all the properties I can find in all activities.

Any suggestions on how to work around this would be most appreciated.

Regards,

Patrick

FYI I have found a workaround by breaking up this into 2 workflows (launch/click), which works just fine and suits the maturity of the process being developed (Launch goes into an Initialise workflow)

Would love to know if anyone can explain this behaviour though.

Hello @patrick.ottery, Welcome to the UiPath Community!

Did you try open application activity? With this activity you might not need to have 2 separate workflows.

Best,
Robin

Hi

Welcome to uipath forum

Actually use application itself will open a new instance every time if you want and If the application is not already open, it is opened when the project is executed

To do that * You can launch a new instance of the application or a new browser session, retaining the current configuration settings, by using the open_app|autoxautoopen_app|autoxauto button next to the Application Path (in case of an application) or Browser URL (in case of a browser) field. If opening a Browser via this button, please note that all configurations made in the Options - Browser property section are applied, thus enabling you to test the behaviour of the activity at design time, mitigating possible failures at run time.

  • Configure application launch settings:
  • If the application is a web browser, you can click Plus plus button|autoxautoplus button|autoxauto on the right side of the Browser URL field, and then use one of the options in the menu to edit the URL of the web page to open.
  • If the application is not a web browser, you can specify parameters to pass to the target application at startup from the Application arguments field. For example, if the target application is Acrobat Reader, you can open a specific PDF file by providing the full path to the file. To open the file C:\Sample.pdf, click Plus plus button|autoxautoplus button|autoxauto > Text , and then enter C:\Sample.pdf in the Text Builder. Certain application types are automatically identified and autofill the Arguments property, such as Java apps, Office Suite apps, Adobe Acrobat, or Windows File Explorer.
  • If the application is not a web browser, you can click Plus plus button|autoxautoplus button|autoxauto on the right side of the Application path field, and then use one of the options in the menu to edit the full path of the executable file to open. For applications installed in user mode, the automation does not save the actual path that includes the username, a relative path is used and displayed in the field as User Folder .

Cheers @patrick.ottery

Thanks @Palaniyappan & @AKM_Robinuzzaman for the quick replies.
I’m using v2021.10 which doesn’t have the Open Application activity, as it seems to have been replaced with the Use Application/Browser which to be honest has worked really well in all other cases so far.
If I open older projects, I can still see/use the Open Application activity, FYI.

@patrick.ottery It is always best practise to clear all the applications before the actual automation starts. Please follow the below steps

Approach 1:

  • Use kill process
  • Use application browser, within that do the required actions. Make sure the close property of the use application browser is set to never

Approach 2:

  • Use kill process
  • Use application browser just to open the application. After it opens successfully
  • Again use application browser to do the remaining actions. Make sure the close property of the use application browser is set to never

Please find the attached workflow for ref

UI.zip (5.8 KB)

Hi Ushu, thanks for your reply, sorry it took me so long to get back to this.
I have done what you mentioned, but it is still giving an error unless I split the 2 phases into multiple workflows, or I need to run the workflow a second time.

Anyway, I’ve got my workaround and it seems nobody else is having this problem so I’ll let it go for now, as I have bigger fish to fry.