我在 Windows 机器(Windows Server 2012 R2 Standard)上使用最新的Selenium Standalone Server(3.0.0-beta2)安装了 Java(Java 版本“1.8.0_101”)。
我正在使用以下命令执行 JAR:
java -jar selenium-server-standalone-3.0.0-beta1.jar -port 8888
现在,当我请求http://localhost:8888时,Jetty 会收到一个 HTTP 404 错误:
HTTP ERROR: 404
Problem accessing /. Reason:
Not Found
Powered by Jetty://
端口 8888 是免费的,没有被任何其他程序使用。
这是我启动服务器时的控制台输出:
11:17:26.292 INFO - Selenium build info: version: '3.0.0-beta1', revision: '8e4315c'
11:17:26.292 INFO - Launching a standalone Selenium Server
2016-08-03 11:17:26.371:INFO::main: Logging initialized @1176ms
11:17:26.542 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:17:26.542 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
11:17:26.558 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN8
2016-08-03 11:17:26.700:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2016-08-03 11:17:26.793:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@6d8a00e3{/,null,AVAILABLE}
2016-08-03 11:17:27.027:INFO:osjs.ServerConnector:main: Started ServerConnector@1d057a39{HTTP/1.1}{0.0.0.0:8888}
2016-08-03 11:17:27.027:INFO:osjs.Server:main: Started @1839ms
11:17:27.043 INFO - Selenium Server is up and running
尝试实例化 RemoteWebDriver(使用 .NET API)时,出现以下异常:
new RemoteWebDriver(new Uri("http://127.0.0.1:8888"), DesiredCapabilities.HtmlUnitWithJavaScript())
WebDriver.dll 中出现“OpenQA.Selenium.WebDriverException”类型的未处理异常
附加信息:意外错误。
错误 405
HTTP 错误:405
访问 /session 时出现问题。原因:
此 URL 不支持 HTTP 方法 POST
由码头提供支持://