Reliable way to wait for a Java application launched from a web app in UiPath

Hi all,
I’m automating a workflow where I log into a web application and then click a menu item that launches a Java desktop application.

Currently:

  • The web automation works fine.
  • The Java app has the UiPath Java extension enabled, but I’m struggling to reliably detect when the Java window is ready.
  • I don’t see an Element Exists activity under UI Automation — only Computer Vision options.
  • I’ve tried Computer Vision Element Exists, but it throws the following error:

The indicated element does not belong to the same application browser

  • Using Retry Scope seems logical, but I’m unsure of the best way to configure it in this scenario.

Questions:

  1. What’s the best practice to wait for a Java app to appear after clicking from a web app?
  2. Should I stick with Computer Vision for detecting Java elements, or is there a way to use native UI Automation?
  3. Any tips for structuring Retry Scope to reliably trigger my Java automation sequence?

Thanks in advance!

hi, @Daniel_Oisebe Use native Java extension with the Element Exists activity to detect the Java app window if you cant find make sure in activities panel you have right check on classic activities…after that it should be available

retry scope
optional combined with App State (a construct in which element exists functionality is involved)

put main focus on:

  • Number Of Retries - The number of times that the sequence is to be retried.
  • Retry Interval - Specifies the amount of time between each retry.

e.g. ussually the application needs ~ 35 secs to load:

retries: 10
interval (the ~sleep beetween the retries) 5 sec

so retry scope is elastic on 10*5sec = 50sec in segments to react on the loadings

Keep in mind:
default timeouts e.g. from a Ui-Interaction Activity (click, type into…) can make some extensions to the wait / retry segements. To controll this we can tune by setting small timeouts to the timeout configuration parameter of the activity

@Daniel_Oisebe

New name for element exists is ‘Check App State’

also were you able to indicate the elements? if not then first troubleshoot the java extension..also depending on version you might need as well

cheers

Thanks for the guidance — I’ve implemented the Retry Scope combined with Try Catch, and it’s working well for handling retries and exceptions.

The only remaining challenge I’m facing is:

  • Waiting for the new Java application to fully open after launching it from the web app.
  • Determining the right moment to place the Use Application/Browser activity to attach and continue with UI automation reliably.

with the nature of retry scope we can also let fail Use Browser/Application (modify Open, Close to never). Any Exception will trigger the retry from the retry scope

grafik

Also you can check additional if the Application will create a new JAVA Process and on ProcessLevel (Process.GetProcessesByName(…)) evaluation you may can detect when it is worth to continue in the flow and step to the retry scope.

For sure, you can combine, adapt, modify or vary these different approaches as well