selenium-server-standalone.jar无法启动

来源:互联网 发布:网络用语ng是什么意思 编辑:程序博客网 时间:2024/06/04 23:23

java -jar selenium-server-standalone-2.48.0.jar -htmlSuite *firefox http://localhost:8080/ F:\selenium\selenium-2.41.0\login_suite.html F:\selenium\selenium-2.41.0\results.html -port 4445 

执行bat命令时一闪而过,就需要打开cmd将bat命令拖入其中执行

*注意要cd到该文件存在的目录下

执行后查看错误信息:

15:52:06.641 WARN - Failed to start: SocketListener0@0.0.0.0:4445Exception in thread "main" java.net.BindException: Selenium is already running on port 4445. Or some other service is.        at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:479)        at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:292)        at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:232)        at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:64)

其实刚接触这个的时候完全不知道这是什么东西,然后在网上找了很久。

4445端口被占用

需要先kill掉这个端口,才能继续执行

在cmd中查看使用4445端口号的进程号:

netstat -ano|findstr "4445"

执行后会显示:

C:\Documents and Settings\>netstat -ano|findstr "4445"  TCP    0.0.0.0:4445           0.0.0.0:0              LISTENING       2548

杀掉进程号为“2548”的程序:

taskkill -f -pid 2548
重新执行bat就可以了

0 0
原创粉丝点击