我让Selenium在Cruise Control下运行,每天测试一次我们的网站。星期六,Selenium开始抛出错误。
周五晚上成功运行的测试之间没有更改代码。此外,同样的事情发生在三台不同的机器上,所以我认为它必须是机器上的东西,如Windows更新。我看不出有任何部署了。
我该怎么做呢?
java -jar selenium-server.jar -port 4445
14:00:35.375 INFO - Java: Sun Microsystems Inc. 14.3-b01
14:00:35.375 INFO - OS: Windows 2003 5.2 x86
14:00:35.390 INFO - v1.0 [2677], with Core v@VERSION@ [@REVISION@]
14:00:35.500 INFO - Version Jetty/5.1.x
14:00:35.500 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:00:35.515 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:00:35.515 INFO - Started HttpContext[/,/]
14:00:35.531 INFO - Started SocketListener on 0.0.0.0:4445
14:00:35.546 INFO - Started org.mortbay.jetty.Server@dbe178
14:00:42.812 INFO - Checking Resource aliases
14:00:42.843 INFO - Command request: getNewBrowserSession[*iexplore, http://test.com/, ] on session null
14:00:42.859 INFO - creating new remote session
14:00:42.968 INFO - Allocated session 1e1f23e664184a3ebdd30c06c4759960 for http://test.com/, launching...
14:00:42.968 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.IllegalArgumentException: Resource not found: /core
at org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResourcePath(ResourceExtractor.java:39)
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java:85)
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(HTABrowserLauncher.java:60)
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchRemoteSession(HTABrowserLauncher.java:140)
at org.openqa.selenium.server.browserlaunchers.InternetExplorerLauncher.launchRemoteSession(InternetExplorerLauncher.java:77)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:357)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:122)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:84)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:697)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:394)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:365)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:126)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
14:00:42.968 INFO - Got result: Failed to start new browser session: Error while
launching browser on session null
14:00:43.046 INFO - Command request: testComplete[, ] on session null
14:00:43.046 INFO - Got result: OK on session null
答案 0 :(得分:1)
我遇到了类似的问题。无论我试图启动什么浏览器,它都会在那里停留一段时间(进程已启动,但没有可见窗口),然后最终失败。这是在Windows 7上,通过java执行测试。
事实证明我只需要结束所有其他浏览器。在测试时我无法打开IE,Firefox或Chrome。也许你应该尝试一下?祝你好运!
答案 1 :(得分:0)
我将Selenium RC服务器升级到1.0.3(2010年2月23日发布),测试又开始了!我不知道问题是什么,但是修复了它。