1 Reply Latest reply: May 19, 2012 12:54 PM by Dominik Grupp RSS

    Using Drone for a client test fails because element cannot be found

    Dominik Grupp Newbie

      Hello,

       

      trying to use Drone for testing as a client I do get the below exception. Although the login form does have the given id and the field "loginname" the test run says it can't find the id. It fails for both DefaultSelenium and GrapheneSelenium (test classes see below). What is missing / wrong? I tried to follow the example given on http://arquillian.org/guides/functional_testing_using_drone/ Sorry for all the code postings below but it could be useful to track the problem down.

       

      com.thoughtworks.selenium.SeleniumException: ERROR: Element id=loginForm:loginname not found

                at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:112)

                at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:106)

                at com.thoughtworks.selenium.DefaultSelenium.type(DefaultSelenium.java:317)

                at de.comp.login.LoginTestSelenium.loginUserClient(LoginTestSelenium.java:41)

                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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)

                at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)

                at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:53)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

                at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)

                at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:300)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

           

      Output on console

         

      log4j:WARN No appenders could be found for logger (org.jboss.logging).

      log4j:WARN Please initialize the log4j system properly.

      log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

      18:21:16.316 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null

      18:21:16.321 INFO - creating new remote session

      18:21:16.354 INFO - Allocated session 6bbffc1f992c441289b33daa139ff53c for http://localhost:8080, launching...

      18:21:16.406 INFO - Preparing Firefox profile...

      18:21:19.177 INFO - Launching Firefox...

      18:21:21.573 INFO - Got result: OK,6bbffc1f992c441289b33daa139ff53c on session 6bbffc1f992c441289b33daa139ff53c

      18:21:21.580 INFO - Command request: setSpeed[0, ] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:21.580 INFO - Got result: OK on session 6bbffc1f992c441289b33daa139ff53c

      18:21:21.583 INFO - Command request: setTimeout[60000, ] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:21.593 INFO - Got result: OK on session 6bbffc1f992c441289b33daa139ff53c

      18:21:40.939 INFO - Command request: open[http://127.0.0.1:8080/admshowtest/login.jsf, ] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:40.940 WARN - you appear to be changing domains from http://localhost:8080 to http://127.0.0.1:8080/admshowtest/login.jsf

      this may lead to a 'Permission denied' from the browser (unless it is running as *iehta or *chrome,

      or alternatively the selenium server is running in proxy injection mode)

      18:21:41.506 INFO - Got result: OK on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.509 INFO - Command request: type[id=loginForm:loginname, fix] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.514 INFO - Got result: ERROR: Element id=loginForm:loginname not found on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.888 INFO - Command request: close[, ] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.904 INFO - Got result: OK on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.906 INFO - Command request: testComplete[, ] on session 6bbffc1f992c441289b33daa139ff53c

      18:21:41.906 INFO - Killing Firefox...

      18:21:41.982 INFO - Got result: OK on session 6bbffc1f992c441289b33daa139ff53c

       

      Test class

       

      package de.comp.login;

      import java.net.URL;

      import org.apache.log4j.Logger;

      import org.jboss.arquillian.container.test.api.Deployment;

      import org.jboss.arquillian.container.test.api.RunAsClient;

      import org.jboss.arquillian.drone.api.annotation.Drone;

      import org.jboss.arquillian.junit.Arquillian;

      import org.jboss.arquillian.test.api.ArquillianResource;

      import org.jboss.shrinkwrap.api.Archive;

      import org.junit.Assert;

      import org.junit.Test;

      import org.junit.runner.RunWith;

      import com.thoughtworks.selenium.DefaultSelenium;

      import de.comp.tools.Deployments;

       

      @RunWith(Arquillian.class)

      public class LoginTestSelenium {

       

                final static Logger logger = Logger.getLogger(LoginTestSelenium.class);

       

        @Deployment

                public static Archive<?> createTestArchive() {

                          return Deployments.createLoginScreenDeployment();

                }

       

                @Drone

                DefaultSelenium browser;

       

                @ArquillianResource

                URL deploymentURL;

       

                @Test

                @RunAsClient

                public void loginUserClient() throws Exception {

                          browser.open(deploymentURL + "login.jsf");

       

                          browser.type("id=loginForm:loginname", "fix");

                          browser.type("id=loginForm:password", "aaa");

                          browser.click("id=loginForm:login");

                          browser.waitForPageToLoad("15000");

       

                          Assert.assertTrue("User should be logged in!", browser.isElementPresent("xpath=//li[contains(text(), 'Welcome')]"));

                }

       

      }

       

        

      Packaging class

       

      package de.comp.tools;

      import java.io.File;

      import org.apache.commons.io.FileUtils;

      import org.jboss.shrinkwrap.api.GenericArchive;

      import org.jboss.shrinkwrap.api.ShrinkWrap;

      import org.jboss.shrinkwrap.api.spec.WebArchive;

      import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;

      import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;

      import de.comp.login.Login;

       

      public class Deployments {

       

      public static final String WEBAPP_SRC = "src/main/webapp";

      public static final String RESOURCES_SRC = "src/main/resources";

       

                public static WebArchive createLoginScreenDeployment() {

                          WebArchive war = ShrinkWrap

                                              .create(WebArchive.class, "admshowtest.war")

                                              .addPackages(true, Login.class.getPackage(), PasswordDigest.class.getPackage())

                                              .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))

                                              .addAsLibraries(

                                                                  DependencyResolvers.use(MavenDependencyResolver.class).artifact("de.comp:admdomain:jar:1.0")

                                                                                      .artifact("de.comp:admserv:jar:1.0").artifact("javax.enterprise:cdi-api:jar:1.0")

                                                                                      .artifact("org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final")

                                                                                      .artifact("org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:jar:1.0.0.Final")

                                                                                      .artifact("org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final")

                                                                                      .artifact("org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.0.Final")

                                                                                      .artifact("org.hibernate:hibernate-jpamodelgen:jar:1.1.1.Final")

                                                                                      .artifact("javax.servlet:servlet-api:jar:2.5").artifact("commons-el:commons-el:jar:1.0")

                                                                                      .artifact("org.apache.myfaces.tomahawk:tomahawk20:jar:1.1.12")

                                                                                      .resolveAs(GenericArchive.class));

       

                          war = addWebResourcesTo(RESOURCES_SRC,war);

                          war = addWebResourcesTo(WEBAPP_SRC,war);

       

                          return war;

                }

       

                private static WebArchive addWebResourcesTo(String path, WebArchive archive) {

                          final File webAppDirectory = new File(path);

                          for (Object content : FileUtils.listFiles(webAppDirectory, null, true)) {

                                    if (content instanceof File) {

                                              File file = (File) content;

                                              if (!file.isDirectory()) {

                                                        archive.addAsWebResource(file, file.getPath().substring(path.length()));

                                              }

                                    }

                          }

                          return archive;

                }

       

       

      }

       

        login.jsf

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

                xmlns:f="http://java.sun.com/jsf/core"

                xmlns:h="http://java.sun.com/jsf/html"

                xmlns:ui="http://java.sun.com/jsf/facelets">

      <head>

      <title>Login</title>

      </head>

      <body>

                <ui:composition template="/templates/templateLogin.xhtml">

                          <ui:param name="title" value="#{msgs.title_main} - #{msgs.login}" />

                          <ui:define name="content">

                                    <h3>#{msgs.eingabe}</h3>

                                    <h:messages/>

                                    <h:form id="loginForm">

                                              <h:panelGrid columns="2">

                                                        #{msgs.name}

                                                                  <h:inputText id="loginname" value="#{credentials.username}" required="true" />

                                                                  #{msgs.password}

                                                                  <h:inputSecret id="password" value="#{credentials.password}" required="true" />

                                              </h:panelGrid>

                                              <p>

                                                        <h:commandButton id="login" value="#{msgs.login}" action="#{login.login}" />

                                              </p>

                                    </h:form>

                          </ui:define>

                </ui:composition>

      </body>

      </html>

       

      Produced html

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"><head>

                          <link rel="shortcut icon" type="image/x-icon" href="/admshow/resources/images/favicon.ico" />

                          <title>KDS - Anmelden</title>

                          <script type="text/javascript">

                                    function fokusieren() {

                                              document.forms["loginForm"].elements["loginForm:loginname"]

                                                                  .focus();

                                    }

                          </script><link type="text/css" rel="stylesheet" href="/admshow/javax.faces.resource/css/styles.css.jsf" /></head><body onload="fokusieren()">

                          <div id="container">

                                    <div id="contentLogin">

                                    <h3>Bitte die Zugangsdaten eingeben</h3>

      <form id="loginForm" name="loginForm" method="post" action="/admshow/login.jsf" enctype="application/x-www-form-urlencoded">

      <input type="hidden" name="loginForm" value="loginForm" />

      <table>

      <tbody>

      <tr>

      <td>Name</td>

      <td><input id="loginForm:loginname" type="text" name="loginForm:loginname" /></td>

      </tr>

      <tr>

      <td>Paßwort</td>

      <td><input type="password" name="loginForm:j_idt14" value="" /></td>

      </tr>

      </tbody>

      </table>

      <p><input type="submit" name="loginForm:j_idt16" value="Anmelden" />

      </p><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-2591643360860621967:587266448580307690" autocomplete="off" />

      </form>

      </div>

      </div></body>

      </html>

       

      Testclass using Graphene

       

      package de.comp.login;

       

      import static org.jboss.arquillian.ajocado.Graphene.elementPresent;

      import static org.jboss.arquillian.ajocado.Graphene.id;

      import static org.jboss.arquillian.ajocado.Graphene.jq;

      import static org.jboss.arquillian.ajocado.Graphene.waitForHttp;

      import static org.jboss.arquillian.ajocado.Graphene.waitModel;

      import java.net.URL;

      import org.apache.log4j.Logger;

      import org.jboss.arquillian.ajocado.framework.GrapheneSelenium;

      import org.jboss.arquillian.ajocado.locator.IdLocator;

      import org.jboss.arquillian.ajocado.locator.JQueryLocator;

      import org.jboss.arquillian.container.test.api.Deployment;

      import org.jboss.arquillian.drone.api.annotation.Drone;

      import org.jboss.arquillian.junit.Arquillian;

      import org.jboss.arquillian.test.api.ArquillianResource;

      import org.jboss.shrinkwrap.api.Archive;

      import org.junit.Assert;

      import org.junit.Test;

      import org.junit.runner.RunWith;

      import de.comp.tools.Deployments;

       

      @RunWith(Arquillian.class)

      public class LoginTestClientGraphene {

       

                final static Logger logger = Logger.getLogger(LoginTestClientGraphene.class);

                public static final String WEBAPP_SRC = "src/main/webapp";

       

                @Drone

                GrapheneSelenium driver;

       

                @ArquillianResource

                URL contextPath;

       

          protected IdLocator USERNAME_FIELD = id("loginForm:loginname");

          protected IdLocator PASSWORD_FIELD = id("loginForm:password");

         

          @Deployment(testable = false)

                public static Archive<?> createTestArchive() {

                          return Deployments.createLoginScreenDeployment();

                }

       

                @Test

                public void loginUserClient() throws Exception {

                          logger.info("contextPath - Pfad: " + contextPath.getPath() + " Datei: " + contextPath.getFile());

         driver.open(contextPath);

              waitModel.until(elementPresent.locator(USERNAME_FIELD));

       

                }

       

      }

       

      Trace when using the Graphene test class

       

      org.jboss.arquillian.ajocado.waiting.WaitTimeoutException: Waiting timed out

                at org.jboss.arquillian.ajocado.waiting.DefaultWaiting.prepareFailure(DefaultWaiting.java:223)

                at org.jboss.arquillian.ajocado.waiting.DefaultWaiting.fail(DefaultWaiting.java:208)

                at org.jboss.arquillian.ajocado.waiting.selenium.DefaultSeleniumWaiting.until(DefaultSeleniumWaiting.java:65)

                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 org.jboss.arquillian.ajocado.framework.internal.WaitingProxy.invoke(WaitingProxy.java:69)

                at $Proxy22.until(Unknown Source)

                at de.comp.login.LoginTestClientGraphene.loginUserClient(LoginTestClientGraphene.java:57)

                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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)

                at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)

                at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:53)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

                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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

                at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)

                at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:300)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

       

       

      Regards,

       

       

      Mike

        • 1. Re: Using Drone for a client test fails because element cannot be found
          Dominik Grupp Newbie

          Here is the solution: in the packaging class faces-config.xml needs to be added explicitly with

           

          .addAsWebInfResource(EmptyAsset.INSTANCE, "faces-config.xml")

           

          It obviously is not enough to add the whole directory (see 1st posting above) which does add the file as well - but not being empty. If added as an empty asset the file really is empty. It possibly does have to do with the automatically generated file WEB-INF/.faces-config.xml.jsfdia but I am not sure.

           

          In the API itself I couldn't find the answer on what does make the difference. I'd highly appreciate it if someone could point me into the right direction to find the answer to that question since it seems it is very important on how the archive is generated using the deployment method.

           

          And sorry for posting that much code above! I thought it might help.