我正在尝试使用网络路径运行Selenium Server,如下所示:
java -jar "\\my-remote-computer-name\Software\selenium-server-2.5.0\selenium-server-standalone-2.5.0.jar"
如何避免此异常:
Sep 6, 2011 11:15:48 AM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
11:15:48.460 INFO - Java: Sun Microsystems Inc. 16.3-b01
11:15:48.462 INFO - OS: Windows 7 6.1 amd64
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.openqa.selenium.server.SeleniumServer.logVersionNumber(SeleniumServer.java:275
at org.openqa.selenium.server.SeleniumServer.logStartupInfo(SeleniumServer.java:678)
at org.openqa.selenium.server.SeleniumServer.<init>(SeleniumServer.java:229)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:200)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:40)
Caused by: java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(Unknown Source)
at org.openqa.selenium.internal.BuildInfo.loadBuildProperties(BuildInfo.java:46)
at org.openqa.selenium.internal.BuildInfo.<clinit>(BuildInfo.java:38)
... 5 more
答案 0 :(得分:0)
实际上我做了很多测试,改变了路径和参数......我发现了:
在Windows 7下,我无法在本地运行命令提示符来调用java
命令调用此selenium服务器jar,而该服务器jar又在另一台计算机中。
我不得不将selenium服务器的jar放在同一台计算机上:
java -jar C:\temp\selenium-server-2.5.0\selenium-server-standalone-2.5.0.jar
这样做,java异常消失了。