结束Windows中浏览器的进程
#-*- coding:utf-8 #结束Windows中浏览器的进程 from selenium import webdriver import unittest class TestDemo(unittest.TestCase): def test_killWindowsProcess(self): #启动浏览器 firefoxDiver = webdriver.Firefox(executable_path="C:\webdriver_firefox_driver") import os #结束Firefox进程 returnCode = os.system("taskfill/F/iM firefox.exe") if returnCode == 0: print "成功结束Firefox进程" else: print u"结束进程失败" if __name__ == "__main__": unittest.main()
原文地址:https://www.cnblogs.com/aszeno/p/10340009.html
时间: 2024-09-30 15:20:27