【发布时间】:2017-06-13 03:52:45
【问题描述】:
我一直在尝试使用Selenium 来运行一些记录在Selenium IDE 中的脚本。我遵循了this blog 的每一步,但我遇到了这个错误:
命令:
java -jar selenium-html-runner-3.0.1.jar -htmlSuite *firefox https://www.google.com "testegglg/Suite.html" "testegglg/result.html"
Unable to find the HTML runner. This is normally because you have not
downloaded
or made available the 'selenium-leg-rc' jar on the CLASSPATH. Your test will
not be run.
Download the Selenium HTML Runner from http://www.seleniumhq.org/download/ and
use that in place of the selenium-server-standalone.jar for the simplest way of
running your HTML suite.
所以,我尝试了 html 运行器并得到了这个:
java -jar selenium-html-runner-3.0.1.jar -htmlSuite *firefox https://www.google.com "testegglg/Suite.html" "testegglg/result.html"
Multi-window mode is longer used as an option and will be ignored.
Starting ChromeDriver 2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320) on port 20688
Only local connections are allowed.
Jan 27, 2017 9:37:03 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Jan 27, 2017 9:37:03 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2017-01-27 09:37:03.864:INFO::main: Logging initialized @787ms
2017-01-27 09:37:03.908:INFO:osjs.Server:main: jetty-9.2.z-SNAPSHOT
2017-01-27 09:37:03.916:INFO:osjsh.ContextHandler:main: Started o.s.j.s.h.ContextHandler@1d296da{/tests,null,AVAILABLE}
2017-01-27 09:37:03.922:INFO:osjs.ServerConnector:main: Started ServerConnector@815b41f{HTTP/1.1}{0.0.0.0:21835}
2017-01-27 09:37:03.923:INFO:osjs.Server:main: Started @846ms
2017-01-27 09:37:03.924:INFO:osjs.ServerConnector:main: Stopped ServerConnector@815b41f{HTTP/1.1}{0.0.0.0:21835}
2017-01-27 09:37:03.925:INFO:osjsh.ContextHandler:main: Stopped o.s.j.s.h.ContextHandler@1d296da{/tests,null,UNAVAILABLE}
Jan 27, 2017 9:37:03 AM org.openqa.selenium.server.htmlrunner.HTMLLauncher mainInt
WARNING: Test of browser failed: *googlechrome
java.io.IOException: java.lang.RuntimeException: java.net.BindException: Address already in use (Bind failed)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.determineSuiteUrl(HTMLLauncher.java:180)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:108)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.mainInt(HTMLLauncher.java:245)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.main(HTMLLauncher.java:273)
Caused by: java.lang.RuntimeException: java.net.BindException: Address already in use (Bind failed)
at org.openqa.selenium.net.PortProber.pollPort(PortProber.java:154)
at org.openqa.selenium.net.PortProber.pollPort(PortProber.java:137)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.determineSuiteUrl(HTMLLauncher.java:174)
... 3 more
Caused by: java.net.BindException: Address already in use (Bind failed)
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.Socket.bind(Socket.java:644)
at org.openqa.selenium.net.PortProber.pollPort(PortProber.java:146)
... 5 more
注意:-port [端口号] 不起作用。
我只想运行我在 IDE 中记录的脚本,以便可以将其与 Jenkins 一起使用。
【问题讨论】:
标签: selenium jenkins automated-tests selenium-ide selenium-rc