I have created some Test Cases in Selenium Python and I have put it in a Test Suite. Each time a Test Case runs it opens the browser and navigates to the URL. It then logs
Slow automated tests caused by needlessly opening and closing browsers, hardcoded delays etc. are, as you say, a huge waste of time, and almost always avoidable in my experience.
The good news is that you don't need to do anything special to avoid this. If your tests are independent and run in sequence, also assuming that you only have one browser/version and set of Capabilities
, then all your test runner needs to do is:
close
or quit
calls, but with all other suitable cleanup (clearing any created cookies, logging out, clearing sessions, Local storage etc.)quit
Driver at the (very) endIt's not very much more work to support multiple browsers / capabilities in much the same way.