Handling Multiple Check App State/Element Exist Scenario

Hello people

This is my first time posting here in UiPath forum, so bear with me.

Anyway, I can’t post the details of my workflow due to privacy and security reasons, but I will try to describe the problem that I encounter through words.

Right now our UI Automation robots are running fine but occasionally (like 1 in 10 transaction) the robot will encounter popups that they need to be handled separately.

My question is, is there ANY way to handle multiple popups that MAY appear using Switch or If activities?

This is the example of the workflow of my current process:

  1. Click button A
  2. Click button B
  3. Sometimes popup X appears and we need to click “OK” button
  4. Some other times popup Y appears and we need to click “Do Invoice” button
  5. Screen C appears
  6. and etc…

My pain points are 3 and 4. There is NO LOGICAL way for a human to know which or when popup X or Y appears. In certain cases (a very small case), both can appear one after another IN NO PARTICULAR ORDER. It’s random, yet the way to solve it is always the same for each popup type.

Right now I handle it by making a quick Check App State against X popup , to check if an element appear (and wait for it for like 5 seconds after that if no popups appear, it won’t do anything and proceed to next activity) and choose the correct way to deal with one.

After that I put another Check App State in case X does not appear, but this time to check whether Y exist or not. Same methods. But this methods makes the robots work slower and right now my company demands the automation to be faster, already face lots of complains and sarcastic remarks due to how slow UI automation is (we used to have API automation but due to all new software, the API is no longer available/currently in development).

TLDR: Keep in mind that I am not going to use try catch on this matter. These popups are not error and I ain’t going to wait for timeout error to appear before I can handle those popups. I simply wonder is there any way to handle this matter without implementing “Check X and wait for 5 seconds → Yes/No → Check Y and wait for 5 seconds → Yes/No”


How about using Parallel activity and multiple CheckAppState activity as the following?


Good idea. Can we make more than two parallel? Something like three Check App State at once?


Parallel activity can also has 3 or more activities. We can put just single parallel activity for your requirement, i think. (However, please note that multiple activities in parallel might reduce readability and maintainability.)


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.