标签:测试用例 rom tde mode col elf trace dead oserror
问题描述:执行多个用例的时候,会抛出异常:
Traceback (most recent call last): File "F:\Demo\pomGisStu\gis\test_case\models\mytest.py", line 9, in setUp self.driver = browser() File "F:\Demo\pomGisStu\gis\test_case\models\driver.py", line 4, in browser return webdriver.Chrome() File "F:\软件\python3.6.1\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 61, in __init__ self.service.start() File "F:\软件\python3.6.1\lib\site-packages\selenium\webdriver\chrome\service.py", line 66, in start self.service_args, env=env, stdout=PIPE, stderr=PIPE) File "F:\软件\python3.6.1\lib\subprocess.py", line 594, in __init__ _cleanup() File "F:\软件\python3.6.1\lib\subprocess.py", line 205, in _cleanup res = inst._internal_poll(_deadstate=sys.maxsize) File "F:\软件\python3.6.1\lib\subprocess.py", line 1025, in _internal_poll if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0: OSError: [WinError 6] 句柄无效。
问题分析:
经查询得知,是因为后台有多个chromedriver.exe被启动,应该关闭它,自测得知最多只能打开三个测试用例的的浏览器
解决办法:
利用quit()方法关闭浏览器,不能使用close()方法关闭。
【Selenium + Python】之OSError: [WinError 6] 句柄无效。
标签:测试用例 rom tde mode col elf trace dead oserror
原文地址:https://www.cnblogs.com/Owen-ET/p/9377054.html