Selenium RC htmlsuite错误

时间:2010-06-15 17:25:56

标签: selenium testing selenium-rc

我正在尝试使用Selenium RC,但每当我启动服务器时,我都会收到此错误。

我使用的命令是

java -jar selenium-server.jar -multiwindow -htmlsuite * iexplore http://localhost/app testsuite.html testsuiteoutfile.html


    Starting Selenium Server....
    18:14:29.086 INFO - Java: Sun Microsystems Inc. 10.0-b23
    18:14:29.086 INFO - OS: Windows XP 5.1 x86
    18:14:29.102 INFO - v2.0 [a2], with Core v2.0 [a2]
    18:14:29.227 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
    18:14:29.227 INFO - Version Jetty/5.1.x
    18:14:29.242 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
    18:14:29.242 INFO - Started HttpContext[/selenium-server,/selenium-server]
    18:14:29.242 INFO - Started HttpContext[/,/]
    18:14:29.336 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@2bbd86
    18:14:29.352 INFO - Started HttpContext[/wd,/wd]
    18:14:29.367 INFO - Started SocketListener on 0.0.0.0:4444
    18:14:29.367 INFO - Started org.openqa.jetty.jetty.Server@14ed9ff
    HTML suite exception seen:
    java.lang.RuntimeException: sessionId 69367 doesn't exist; perhaps this session was already stopped?
            at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:220)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.writeSessionExtensionJs(HTABrowserLauncher.java:117)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java:102)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(HTABrowserLauncher.java:63)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchHTMLSuite(HTABrowserLauncher.java:155)
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:121)
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:166)
            at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:545)
            at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:239)
            at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:198)
    18:14:30.320 INFO - Shutting down...

我尝试使用不同的端口号并在调试模式下输出显示在这里

没有其他测试或应用程序在端口4444上运行。我甚至尝试重启我的机器只是为了确认。 当我尝试使用端口6565并在调试模式下启动它时,再次出现错误

    C:\workarea\wip\SeleniumSuite>runenssuite all
    Starting Selenium Server....
    18:35:06.088 INFO - Java: Sun Microsystems Inc. 10.0-b23
    18:35:06.104 INFO - OS: Windows XP 5.1 x86
    18:35:06.104 INFO - v2.0 [a2], with Core v2.0 [a2]
    18:35:06.119 INFO - Selenium server running in debug mode.
    18:35:06.135 DEBUG - add component: SocketListener0@0.0.0.0:6565
    18:35:06.166 DEBUG - add component: org.openqa.jetty.http.ResourceCache@18a47e0
    18:35:06.182 DEBUG - add component: org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
    18:35:06.182 DEBUG - add component: HttpContext[/,/]
    18:35:06.182 DEBUG - Added HttpContext[/,/] for host *
    18:35:06.182 DEBUG - add component: org.openqa.jetty.http.ResourceCache@89fbe3
    18:35:06.197 DEBUG - added SC{BASIC,null,user,CONFIDENTIAL} at /tests/html/basicAuth/*
    18:35:06.213 DEBUG - add component: org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.213 DEBUG - add component: org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.229 DEBUG - add component: org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.229 DEBUG - add component: org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-ser
    ver]
    18:35:06.229 DEBUG - add component: org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler@1bf6770
    18:35:06.244 DEBUG - add component: org.openqa.selenium.server.CachedContentTestHandler@94948a
    18:35:06.244 DEBUG - add component: HttpContext[/selenium-server,/selenium-server]
    18:35:06.244 DEBUG - Added HttpContext[/selenium-server,/selenium-server] for host *
    18:35:06.260 DEBUG - add component: org.openqa.jetty.http.ResourceCache@c51355
    18:35:06.276 DEBUG - add component: org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.276 DEBUG - add component: HttpContext[/selenium-server/driver,/selenium-server/driver]
    18:35:06.291 DEBUG - Added HttpContext[/selenium-server/driver,/selenium-server/driver] for host *
    18:35:06.291 DEBUG - add component: org.openqa.jetty.http.ResourceCache@253498
    18:35:06.307 DEBUG - add component: WebDriver remote server
    18:35:06.322 DEBUG - add component: org.openqa.jetty.jetty.servlet.HashSessionManager@16930e2
    18:35:06.322 DEBUG - add component: org.openqa.jetty.jetty.servlet.ServletHandler@108786b
    18:35:06.354 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:6565/wd/hub
    18:35:06.354 DEBUG - add component: HttpContext[/wd,/wd]
    18:35:06.354 DEBUG - Added HttpContext[/wd,/wd] for host *
    18:35:06.369 DEBUG - Starting org.openqa.jetty.jetty.Server@18eb9e6
    18:35:06.369 INFO - Version Jetty/5.1.x
    18:35:06.369 DEBUG - LISTENERS: [SocketListener0@0.0.0.0:6565]
    18:35:06.385 DEBUG - HANDLER: {null={/selenium-server/driver/*=[HttpContext[/selenium-server/driver,/selenium-server/driver]], /selenium-server/*=[Htt
    pContext[/selenium-server,/selenium-server]], /=[HttpContext[/,/]], /wd/*=[HttpContext[/wd,/wd]]}}
    18:35:06.385 DEBUG - Starting HttpContext[/selenium-server/driver,/selenium-server/driver]
    18:35:06.385 DEBUG - Init classloader from null, sun.misc.Launcher$AppClassLoader@11b86e7 for HttpContext[/selenium-server/driver,/selenium-server/dri
    ver]
    18:35:06.401 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
    18:35:06.401 DEBUG - Starting HttpContext[/selenium-server,/selenium-server]
    18:35:06.401 DEBUG - Init classloader from null, sun.misc.Launcher$AppClassLoader@11b86e7 for HttpContext[/selenium-server,/selenium-server]
    18:35:06.416 DEBUG - Started org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.416 DEBUG - Started org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.416 DEBUG - Started org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.416 DEBUG - Started org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.432 DEBUG - Started org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
    18:35:06.432 INFO - Started HttpContext[/selenium-server,/selenium-server]
    18:35:06.432 DEBUG - Starting HttpContext[/,/]
    18:35:06.432 DEBUG - Init classloader from null, sun.misc.Launcher$AppClassLoader@11b86e7 for HttpContext[/,/]
    18:35:06.447 DEBUG - Started org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
    18:35:06.447 INFO - Started HttpContext[/,/]
    18:35:06.447 DEBUG - Starting HttpContext[/wd,/wd]
    18:35:06.447 DEBUG - Init classloader from null, sun.misc.Launcher$AppClassLoader@11b86e7 for HttpContext[/wd,/wd]
    18:35:06.463 DEBUG - Starting org.openqa.jetty.jetty.servlet.ServletHandler@108786b
    18:35:06.463 DEBUG - New random session seed
    18:35:06.557 DEBUG - Started holder of class org.openqa.selenium.remote.server.DriverServlet
    18:35:06.557 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@108786b
    18:35:06.572 INFO - Started HttpContext[/wd,/wd]
    18:35:06.572 DEBUG - Session scavenger period = 30s
    18:35:06.588 INFO - Started SocketListener on 0.0.0.0:6565
    18:35:06.588 INFO - Started org.openqa.jetty.jetty.Server@18eb9e6
    18:35:06.604 DEBUG - Requested browser string '*iehta' matches *iehta
    18:35:06.697 DEBUG - Extracting /core to c:\DOCUME~1\702723~1\LOCALS~1\Temp\customProfileDir306604\core
    HTML suite exception seen:
    java.lang.RuntimeException: sessionId 306604 doesn't exist; perhaps this session was already stopped?
            at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:220)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.writeSessionExtensionJs(HTABrowserLauncher.java:117)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java:102)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(HTABrowserLauncher.java:63)
            at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchHTMLSuite(HTABrowserLauncher.java:155)
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:121)
            at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:166)
            at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:545)
            at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:239)
            at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:198)
    C:\workarea\wip\SeleniumSuite>

更新#19:37 确定另一个更新 - 如果我将浏览器从* iexplore更改为* iexploreproxy它似乎工作。这有什么理由吗?

更新#21:45 我试图下载旧版本的Selenium RC,旧版本(0.9.2)工作正常。它可能只影响新版本。

1 个答案:

答案 0 :(得分:1)

用于运行html套件的命令中记录了一个观察结果:您可以尝试以下命令:

java -jar selenium-server.jar -htmlSuite *iexplore "http://localhost/app" "testsuite.html" "testsuiteoutfile.html"

注1:请确保您指的是'testsuite.html'所在的正确路径。例如:“C:\ testsuite.html”

注2:同样适用于输出文件,请确保引用要保存结果的特定目录。