Hello,
I am facing some interesting issues, while creating processes.
I’m trying to clear environment before initializing robots (here: closing all Internet Explorer’s browsers).
I am curious, if anybody knows, why If Statement, included in screen shot given below, works as Loop? What I mean is, if plenty of IE browsers are opened, it closes the first one, then waits some amount of time, and then suddenly closes all others browsers.
And this statement works like this only with Browser Applications.
Could anyone tell me please, why is it so? Why this IF works like loop here? Why it doesn’t close only one process, but whole bunch of it?
It’s not the If that’s acting like a loop it’s the Close Applicaton Activity (you can try this by isolating the close application activity outside the if)
I’m definitely not sure on why this is happening though. I guess since you specify iexplorer as the application and that it detects that there are still iexplorer windows it has a retry mechanism built in.
I’m hoping someone more experienced could shed some light on this mistery
Single Close Application works like this, IF activity is not necessary here.
It works also with another browser, eg. Chrome.
But if I want to close notepad in a way like this, it only closes 1 window.
So is it some special issue in Close application only for browsers? It’s very convinient though, but if it’ll work always like this?
This is because GetProcessByName.Count will give you all the running iexplore.exe and when you are closing the application your selector is not specific to any one opened window that is why it is closing everything in your case.
Though it should not behave like this in either case because even if you want to close iexplore.exe if so many tabs are open it will ask you a question “Do you want to close all the tabs or current tab”. You must be more specific to selector while closing the application.
While if you have them opened in different windows it will successfully close only one window with the help of title attribute.
What do you mean by “you must be more specific to selector” ? I want to close all IE processes. Not only one.
And even if “Do you want to close all tabs?” box pops up, it also closes it all. Without my help. Even IF statement I posted is not necessary. It works the same without IF. Same Close App activity is sufficient.
Behaviour : The robot closed the first window (Google) and after a while closed the other one (Bing) even though the title for bing is different.
I think this is why we have two different activities, close tab for browsers so we can close a particular tab and close application will close all the windows of the selected browser.
It does specify on the UiPath Guide that the activity works differently for browser , applications and SAP :
This is something strange because it is working perfectly at my end.
I was having 4 different windows Yahoo, Google, MSN and Bing I selected Bing as title in selector and it worked, it closed the one window which was having title as Bing