How to reattach browser inside attach browser activity?

browser
studio

#1

Hello community,

I have a question to the attach browser activity. I used it to develop a workflow in a web-based app, so I created all activities like click, type into etc. inside the attach activity.

Now I deal with exception handling including the restart of the web based app, if the app does not react anymore (which can happen sometimes). But I notized, that a restart of the browser inside the attach browser activity is not practicable since, the ui automation activities throw the error: AggregationException: One or more errors orrcured. I assume, that these activities does not know the current browser object anymore and the actions cannot be performed.

So I need a solution, where I can kind of reattach the browser inside an attach browser activity, while other activities do not noticed this change. Is there a way to do this? Unfortunately the refresh activity is not helpful enough.

Greetings
Nico


#2

If it the browser terminates, then you need to re-initialize again. You won’t be able to pass the old browser variable as it no longer exists.

You will have to re-attach browser using selectors. Another option is to store the URL at each change, then if a crash happens, you can use an open browser activity and supply the last URL that was used.