标题: Selenium单元测试框架运行报错:SessionNotCreatedException [打印本页] 作者: f盘装满基情 时间: 2018-2-2 09:25 标题: Selenium单元测试框架运行报错:SessionNotCreatedException 我的代码: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException import unittest, time, re
下边是出错的信息:ErrorTraceback (most recent call last): File "D:\software\Anaconda3\lib\unittest\case.py", line 59, in testPartExecutor yield File "D:\software\Anaconda3\lib\unittest\case.py", line 608, in run self.tearDown() File "C:\Users\zhuyonggang\PycharmProjects\python_learn\selenium_test\unittest框架.py", line 54, in tearDown self.driver.close() File "D:\software\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 679, in close self.execute(Command.CLOSE) File "D:\software\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute self.error_handler.check_response(response) File "D:\software\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrace)selenium.common.exceptions.SessionNotCreatedException: Message: Tried to run command without establishing a connection