How to handle two types of popup using try catch

I am facing issue I have captured both the types of confirmation popup to retrieve the confirmation Id. But on the right side get text captured the text because it identifies the first type of popup but left-sided gets text doesn’t capture anything and show the incorrect element because second type popup not occurred.

1 Like

Try with the following selector -

“<wnd app=‘iexplore.exe’ cls=’#32770’ title=‘Message from webpage’ /><wnd ctrlid=‘65535’ title=‘Report was uploaded - confirmation id is*’ />”

Karthik Byggari

@KarthikByggari Bro will it work for both types of popup?

See same I am using but for different type of popup it’s different

when it check for second type of popup it thrown exception since first type of popup occured. this selectors for second type of popup

are you running parallel or pick branch for the pop ups?

@TimK Running parallely for both the box

@balkishan use a pick activity - Put each pop up (use element exist) in a seperate pick branch :slight_smile:
This should solve your issue as it will continue once it has found one of the pop ups.

@TimK I haven’t use the pic up activity so I don’t have much idea about this

Hi @balkishan

use Parallel Activity in right side put one sequence and left side put one sequence in that use element exist activty based on if condition put get text activity for both.

Note(make sure parallel activity condition properties is true)

otherwise for ur code simply set as True in Parallel Activity condition Properties it will work

Amaresan. P

A pick branch activity is essentially a tree decision based off of a trigger
So if one of the branches (routes) is true it will only go down that route and ignore the other route.

For a pop up ->
Use Element Exists activity for both in the trigger

EE - Pop Up 1 | EE - Pop Up 2

Click OK 1 | Click OK 2

The above explains how it will look, if Pop Up 1 is found using element exist - it will Click OK for pop up 1 with those selectors and similar for pop up 2…

Hope that helps, try it out and see. It is very useful for this type of thing.

Another suggestion could be using a switch - Get the text of the pop up and if you know the specific text you can direct it to that specific case.

1 Like