in InitAllApplications I open the browser and log into the website
Now I’m in the file CloseAllApplications ==> Here is where my question comes in:
How can I close the browser from here using modern activites? I’m aware that I could use this functionality (within my InitAllApplications):
But this has to be set to never. I don’t want the browser to be closed after the initialization, only after the app is done processing all transactions. But how to achieve this?
In CloseAllApplications you can use the use application/Browser activity and set the parameter Close with Always.
This will cause the browser to close, as this activity is in the End Process state, it will be executed at the end of the process.
You should create a close browser/logout workflow which attaches the browser and closes it, i.e. by going through the logging out process, clicking the x button or using a browser command, then invoke this in the CloseAllApplications workflow.
In KillAllProcesses, you should have a Kill Process activity for the browser, in the case that the Browser does not close properly, KillAllProcesses will force close it.
Best practice encourages the creation of reusable, maintainable, minimalistic functions (separated into workflows).
I would advise creating a logging out procedure on the browser for any systems you may be using, then a separate workflow for closing the browser. If you make that distinct separation, you can re-use the close browser in other automations you may make.
With the modern activity pack, using the “use application/Browser” activity and the “Close” property with “Always” you don’t need to click the close button, because the activity itself will close the browser, that’s what this property is for was raised.
Thx all of you.
I created a combination of 2 solutions from @tainan.ramos and @Che
In the CloseAllApplications I added a useApplication Browser and choose the instance thats already opened (via a UI Element variable). I set its close property to always. But before I added a click Activity that logs out first.
@Shikhar_Tandon Thx this one I implemented in KillAllProcesses