1.
弹出框:Port 8005 required by Tomcat v8.5 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port numbe
参考https://blog.csdn.net/enniexiaorui/article/details/70161040
假设要查询端口8080被占用情况,在命令行下输入:netstat -aon|findstr "8080"
得到进程号 18104,继续输入命令: tasklist|findstr "18104"
得到进程映像名称 WeChat.exe
Ctrl + Alt + delete 打开任务管理器,找到 名为 WeChat.exe的进程,右键,结束该进程。
这样端口被占用的问题就解决了。
2.
报错Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
分析driver版本不符合所以找不到
a,浏览器版本查看https://www.cnblogs.com/jinanxiaolaohu/p/10602836.html
b,chrome版本与chromedriver对应表单https://blog.csdn.net/yoyocat915/article/details/80580066
c,驱动下载地址http://chromedriver.storage.googleapis.com/index.html
之后又查看其它介绍d
d,浏览器没调起来参考https://www.cnblogs.com/yhleng/p/9503819.html
最后发现是chrome下载的不对,它的名称为“极速浏览器”,图标长得一样,重新下载chrome后,找到对应chromedriver版本,再跑,就成功了,不过driver驱动地址是绝对路径,System.setProperty ("webdriver.chrome.driver", "D:\\tools\\jar\\chromedriver_win32 -74\\chromedriver.exe" );
左斜杠不要弄错!