0

我正在尝试将 selenium 2.25.0 与 jboss 和 seam 一起使用。我使用以下代码:

@Test
public void testRegistration() throws InterruptedException {
    DefaultSelenium selenium = new DefaultSelenium(
            new WebDriverCommandProcessor("http://localhost:8080",new FirefoxDriver()));
    selenium.open("*****");
    selenium.waitForPageToLoad("30000");
    selenium.type("main_form:name", "***");
    selenium.type("main_form:password", "***");
    selenium.click("main_form:login_button");
    selenium.waitForPageToLoad("30000");
    Assert.assertTrue(selenium.isTextPresent("****"));
    selenium.click("logout");
    selenium.close();
}

但经过测试,它无法停止服务器并给出以下错误:

Exception in thread "main" javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: invoker not bound]
at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1352)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.Shutdown.main(Shutdown.java:219) Caused by: javax.naming.NameNotFoundException: invoker not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)
4

1 回答 1

0

发生这种情况是因为出于某种原因,jboss 在端口 4444 上运行与 rmi 相关的操作,而 selenium 也在 4444 上运行。更改 selenium 的端口(更容易做到)并且你在做生意。

是的,回答了我自己的问题。

于 2012-08-29T16:24:17.827 回答