我已经在eclipse mars .When中添加了selenium jar文件。我启动了firefox浏览器,得到以下错误:
Exception in thread "main" java.lang.RuntimeException: Unable to find a free port
at org.openqa.selenium.net.PortProber.findFreePort(PortProber.java:67)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:326)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:207)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
at Mypackage.Myfirstprogram.main(Myfirstprogram.java:10)
发布于 2017-06-17 05:18:58
Selenium独立服务器默认使用端口号4444。确保此端口未被任何其他进程使用。终止在该端口号上运行的任何进程,或者将任何其他端口号用于selenium独立服务器。
https://stackoverflow.com/questions/44601024
复制相似问题