Я пытался использовать Selenium
для запуска некоторых сценариев, записанных в Selenium IDE
. Я следовал за каждый шаг this blog, и я застрял с этой ошибкой:Selenium скрипты не работают в Selenium Server и Selenium Html Runner
Команда:
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 [email protected]{/tests,null,AVAILABLE} 2017-01-27 09:37:03.922:INFO:osjs.ServerConnector:main: Started [email protected]{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 [email protected]{HTTP/1.1}{0.0.0.0:21835} 2017-01-27 09:37:03.925:INFO:osjsh.ContextHandler:main: Stopped [email protected]{/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
Примечание: -порт [номер порта] не работает.
Я просто хочу запустить сценарии, которые я записал в IDE, поэтому я могу использовать его с Jenkins
.