I am doing automation for application, Where I am getting one popup randomly, there is no fix pattern. Whenever that popup will appear I have to click on “Close” good part is its selector is always same.
Can anyone suggest how to handle this type of popup, One thing I can think is to create one workflow and include after every activity. but its not a good approach I think.
How about use paralel activity and your logic in one Sequence and On Element Appears in another sequence? You need to add timeout to your activities so the On Element activity will buy some time to click on the pop up. This is just an idea.
Beside from the good suggestion from @vvaidya, remember that a programmer did that procedure, so you might be able to track the behavior. have you? I’ts difficult for me to find a class named “Random popup” -
I remember a case downloading PDF’s, where it was a pop up window "when the PDF had more than one sheet" , - basically the invoice had in like 90% of the times 1 sheet, in that time I read Design patterns, and decided to encapsulate that part (the 10% left), I have to say that you will draw your workflow first.
I see, I think that you could do the process normally and just use a try catch and then on the exception click to close the pop up and then manage to continue where you left the process, or start over, you’ll have to determine what is the best solution for this case. What you think?
Yes. It will be too complicated to use lots of try-catches.
Aside Parallel it seems it makes sense to create an activity called PopupScope. Before going to the next instruction within PopupScope it will permanently check if we have a popup on the screen plus it will contain instruvtions on how to handle the popup (click ok, click cancel, etc).
many TryCatch, not really, I think more like, since I had the same synthom when somebody else connect to the webpage to download invoices, I was downloading an invoice lets say IP0001, then on the P1002 the pop up appears, what I did is a try catch. try to download invoice P1002 and if there’s any error click the popup and “end” the process, now, outside the try catch What I had it was an state machine to read in a config file which invoices the robot was able to download and put a log on a certain row, and then since the process stoped on P1002 this row would not have the log, so it will start from there again.
What do you think, I guess I can send you the XAML for your reference if you have doubts on how to implement this.
first add “image exists” then assign a variable to it and then use decision flow activity, in “image exists” give the image of popup, and in the decision flow , in true part use click activity (to close the popup). try this and it should work.