标题: Selenium RC用Eclipse执行,总报Connection refused: connect [打印本页] 作者: csj 时间: 2011-7-4 11:41 标题: Selenium RC用Eclipse执行,总报Connection refused: connect Exception in thread "main" java.lang.RuntimeException: Could not contact Selenium Server; have you started it on 'localhost:4445' ?
Read more at http://seleniumhq.org/projects/remote-control/not-started.html
Connection refused: connect
代码如下,求大侠支招
package SeScript;
public void setUp() throws Exception {
String url = "http://www.google.com";
selenium = new DefaultSelenium("localhost", 4444, "*firefox", url);//4444 is default server port
selenium.stop();
C:\Documents and Settings\Administrator\桌面\study\selenium>java -jar e:\rc\sele
nium-server\selenium-server.jar
11:32:34.227 INFO - Java: Sun Microsystems Inc. 10.0-b19
11:32:34.243 INFO - OS: Windows XP 5.1 x86
11:32:34.337 INFO - v2.0 [a2], with Core v2.0 [a2]
11:32:34.931 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
11:32:34.931 INFO - Version Jetty/5.1.x
11:32:34.962 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
11:32:34.962 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:32:34.962 INFO - Started HttpContext[/,/]
11:32:35.134 INFO - Started [url=mailtorg.openqa.jetty.jetty.servlet.ServletHandler@17182c]org.openqa.jetty.jetty.servlet.ServletHandler@17182c[/url]
1
11:32:35.134 INFO - Started HttpContext[/wd,/wd]
11:32:35.150 INFO - Started SocketListener on 0.0.0.0:4444
11:32:35.150 INFO - Started [url=mailtorg.openqa.jetty.jetty.Server@1c184f4]org.openqa.jetty.jetty.Server@1c184f4[/url]作者: freedom2k 时间: 2011-9-5 13:45
要先启动server,然后再去跑你的用例作者: wuhuawu09 时间: 2011-10-8 14:11
have you started it on 'localhost:4445' ?