1

Ich habe versucht, Selenium zu verwenden, um einige in Selenium IDE aufgezeichnete Skripts auszuführen. Ich habe bei jedem Schritt this blog gefolgt, und habe ich mit diesem Fehler fest:Selen-Skripte funktionieren nicht in Selenium Server und Selenium Html Runner

Befehl:

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.

Also, ich mit dem HTML-Läufer versucht und bekam diese:

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

Hinweis: -port [Nummer des Ports] funktioniert nicht.

Ich möchte nur die Skripte auszuführen i in dem IDE aufgenommen hatte, so kann ich es verwenden, um mit Jenkins.

Antwort

0

Wenn Sie nach der Möglichkeit suchen, Selenium-Skripte zu starten, die in Selenium IDE aufgezeichnet wurden, würde ich Taurus empfehlen, der Selenium-Aktionen ausführen und in ein solches CI-Tool wie Jenkins integriert werden kann. Die Schritt-für-Schritt-Anweisungen sind in diesem Post beschrieben - https://www.blazemeter.com/blog/how-automate-jmeter-and-selenium-testing.