One of two windows might appear

I quite frequently come across scenarios where I have the robot clicking through a series of screens, and it gets to a point where the following things can happen:

Scenario 1:

  • The robot clicks OK on the “Claim Administration Screen”
  • A window appears to say a “Claim is not in payment.”
  • The robt clicks OK and a “Claim Summary” window appears.

Scenario 2:

  • The robot clicks OK on the “Claim Administration Screen”
  • A “Claim Summary” window appears.

Solutions considered:
1. Just putting an element exists in to pick up the “Claim is not in payment” window in Scenario 1 is a bad idea, because if it doesn’t exist, the default delay would be 3 seconds per transaction - although this could be reduced, we cannot be certain the window will appear immediately due to lag on the system.

2. A loop that looks for “Claim is not in payment” and “Claim Summary” in parallel until one appears, then uses an If statement to dismiss the “Claim is not in payment” window if it had appeared. However the problem with this is that if neither appear for some unknown reason, the process is now stuck in an infinite loop.

3. As per solution 2 above, but assigning a “new Stopwatch()”, and using invoke method to start it before the loop, and then setting a condition of the loop to be “stopwatch.Elapsed.TotalSeconds <30”, then adding an If statement to throw a system exception if the stopwatch reaches the 30 second timeout.

I’m currently using solution 3, but is this the best solution?

Thanks

Please check pick branch activity.

First one looks good. If doesn’t found, throw a system exception and again look for the window in the catch block. If doesn’t found even in that time frame then re-throw the exception to halt the workflow.

1 Like

*A loop that looks for “Claim is not in payment” and “Claim Summary” in parallel until one appears, then uses an If statement to dismiss the “Claim is not in payment” window if it had appeared. However the problem with this is that if neither appear for some unknown reason, the process is now stuck in an infinite loop."

you can create a loop using flow decisions:
create an int varible called gaurd before you do the 1st check
do a check for window 1, if exists do whatever,
if not check if window 2 exists and so on
at the end of all the false outcomes , do a check what the gaurd number is , if its >say 60 you have an unknown scenario, if not assign gaurd=gaurd+1 and reloop
put your timeouts on the activities to 250 , that would equal about 15 seconds of wait time

Thank you, If I understand you correctly, something like this?

Certainly looks neater if it works!

1 Like

Thank you, That’s essentially what I’m doing in “Solution 3”, but within a sequence, and I use a stopwatch instead of a counter. A counter means you can’t be certain of the length of time, as loops don’t always run at the same speed.

yes , but the timeout means that the action will wait for 250 milliseconds , if it find the item before that it will jump out , if not it waits up until 250 ms so your loop is 250 ms X 3
therefore you can indeed be certain but stopwatch might do the same

Yes, but with one more branch with a delay. Before jumping out of the pick activity it will wait for given time in the third branch.

2 Likes

Got it… I think. Thank you.

2 Likes

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