Selenium代码:
Started InternetExplorerDriver server (64-bit)
3.8.0.0
Listening on port 25160
Only local connections are allowed
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: session null does not exist (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'TS-39', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
错误:
class LoggingService [Inject] (protected val logger: Logger)
class LoggingService @Inject (protected val logger: Logger)
答案 0 :(得分:1)
错误说明了一切:
org.openqa.selenium.remote.SessionNotFoundException: session null does not exist
您看到 SessionNotFoundException
的主要原因是由于以下原因:
您正在使用版本 3.8.0.0 的 InternetExplorerDriver ,这从以下日志中可以看出并且已正确启动。
Started InternetExplorerDriver server (64-bit)
3.8.0.0
Listening on port 25160
Only local connections are allowed
但您的 Selenium
版本 2.53.1 ,从以下日志中可以看出这一点:
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
此外,您的 JDK 版本的版本比版本 1.8.0_91 更旧,这从以下日志中可以看出:
System info: host: 'TS-39', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
简单的解决方案是:
Test
。