Browser closing

Is it possible to export the "Python 2 (WebDriver+unittest) script and execute it without closing the browser? If so, how would I perform this task?

demond jones said:

Is it possible to export the "Python 2 (WebDriver+unittest) script and execute it without closing the browser? If so, how would I perform this task?

Hello,

You can achieve this by removing this line of code in tearDown method:

self.driver.quit()
def tearDown(self):
        self.driver.quit()
        self.assertEqual([], self.verificationErrors)

When the driver set to quit(), it means to close the current opened browser.

If you still have the problem, please feel free to let us know.

Regards,
Liam

Thank you Liam for the quick reply. So I see what you mentioned has worked. I guess I thought that would work for me and what I wanted to perform. Removing the code above works when I run the script within IDLE; however, I suppose my goal is to have the browser not close when opening the file outside of IDLE so that I can different scripts for automated browser function. I am unable to use it for automated browser functions when the browser will close after completing the script.

Again…it works fine when I press the “run” option in IDLE; the browser will stay open until closed. It is when I double click the script that the browser will close after performing the actions created. Is there a way around this?

Hi. Sorry for the late response. Your question is about a feature outside of Katalon tools and should be best asked on StackOverflow. If you need that feature for your testing activities, you can try Katalon Studio instead of Python’s unittest.