首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Selenium脚本在Selenium Server和Selenium运行程序中不起作用

Selenium脚本在Selenium Server和Selenium运行程序中不起作用
EN

Stack Overflow用户
提问于 2017-01-27 12:52:40
回答 1查看 1.7K关注 0票数 2

我一直试图使用Selenium来运行Selenium IDE中记录的一些脚本。我已经跟踪了这个博客的每一步,并且被这个错误困住了:

命令:

代码语言:javascript
复制
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运行程序,得到了以下结果:

代码语言:javascript
复制
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中使用它了。

EN

回答 1

Stack Overflow用户

发布于 2017-02-04 12:46:14

如果您正在寻找启动Selenium中记录的Selenium脚本的方法,我建议您使用金牛座,它能够执行Selenium操作,并且可以与Jenkins这样的CI工具集成。一步一步的指令在这个后https://www.blazemeter.com/blog/how-automate-jmeter-and-selenium-testing中被描述.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41894423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档