I would like to close the browser completely before opening it when starting a test case. Is there a way I can tell Tosca to close a browser if it is open?
Asked
Active
Viewed 956 times
1 Answers
0
You can use the Standard Module TBox Window Operation to check if a window exists.
Then you could use Toscas "If" function to check via the module if a window with a given name exists and if so, use the same module to close it.
I have this implementation in one of our own projects, it always kill every firefox.exe process and then waits for 5seconds.

TheEisbaer
- 103
- 2
- 12
-
Tried that but the problem is it can only work if the caption corresponds to the currently open tab. If the tab doesn't correspond to that, then it doesn't get closed. – Enigma Sep 03 '22 at 16:31
-
Then you could try using the Start Program module to start "taskkill /F /IM iexplore.exe" for internet explorer for example. – TheEisbaer Nov 03 '22 at 13:17