Integration test using selenium.

Hi again:
I try to do integration test to vaadin application using selenium. My application are integrated with spring, using vaadin-spring, and dependencies of vadin-spring-addon…(version 0.0.7.RELEASE). When test run, the application load, when selenium access to the application url, occurs internal server error (status 500).
This is some clasess configurations:

@SpringBootApplication(exclude = org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class)
@EnableVaadinManagedSecurity
@EnableI18N
@EnableEventBus
@EnableVaadin
@ComponentScan
public class Application{

}

@Theme(“corpustheme”)
@SpringUI(path = “corpus”)
@Widgetset(“cu.datys.corpus.CorpusWidgetset”)
@Log4j
public class CorpusUI extends UI {

}

…and the test class
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebIntegrationTest
@Log4j
public class ApplicationTest {

}
How can I fix this?

Dependendies…
[INFO]
Scanning for projects…
[INFO]

[INFO]

[INFO]
Building Corpus :: Corpus Application 1.0.0-SNAPSHOT
[INFO]

[INFO]

[INFO]
— maven-dependency-plugin:2.9:tree (default-cli) @ corpus-application —
[INFO]
cu.datys.corpus:corpus-application:jar:1.0.0-SNAPSHOT
[INFO]
± org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO]
| ± junit:junit:jar:4.12:test
[INFO]
| ± org.mockito:mockito-core:jar:1.10.19:test
[INFO]
| | - org.objenesis:objenesis:jar:2.1:test
[INFO]
| ± org.hamcrest:hamcrest-core:jar:1.3:test
[INFO]
| ± org.hamcrest:hamcrest-library:jar:1.3:test
[INFO]
| ± org.springframework:spring-core:jar:4.1.7.RELEASE:compile
[INFO]
| - org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO]
± cu.datys.gema.vaadin:gema-vaadin-test:jar:1.0.0-SNAPSHOT:test
[INFO]
| ± com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.5.3:test
[INFO]
| | ± com.fasterxml.jackson.core:jackson-core:jar:2.4.6:compile
[INFO]
| | - org.apache.geronimo.bundles:json:jar:20090211_1:test
[INFO]
| ± net.sf.jtidy:jtidy:jar:r938:test
[INFO]
| ± org.apache.commons:commons-lang3:jar:3.4:compile
[INFO]
| ± commons-io:commons-io:jar:2.4:test
[INFO]
| ± org.projectlombok:lombok:jar:1.16.6:compile
[INFO]
| - com.github.detro:phantomjsdriver:jar:1.2.0:test
[INFO]
| ± org.seleniumhq.selenium:selenium-java:jar:2.41.0:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-chrome-driver:jar:2.41.0:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.41.0:test
[INFO]
| | | - net.sourceforge.htmlunit:htmlunit:jar:2.13:test
[INFO]
| | | ± xalan:xalan:jar:2.7.1:test
[INFO]
| | | | - xalan:serializer:jar:2.7.1:test
[INFO]
| | | ± commons-collections:commons-collections:jar:3.2.1:test
[INFO]
| | | ± org.apache.httpcomponents:httpmime:jar:4.5.1:test
[INFO]
| | | ± net.sourceforge.htmlunit:htmlunit-core-js:jar:2.13:test
[INFO]
| | | ± xerces:xercesImpl:jar:2.11.0:test
[INFO]
| | | | - xml-apis:xml-apis:jar:1.4.01:test
[INFO]
| | | ± net.sourceforge.nekohtml:nekohtml:jar:1.9.19:test
[INFO]
| | | ± net.sourceforge.cssparser:cssparser:jar:0.9.11:test
[INFO]
| | | - org.eclipse.jetty:jetty-websocket:jar:8.1.12.v20130726:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-firefox-driver:jar:2.41.0:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-ie-driver:jar:2.41.0:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-safari-driver:jar:2.41.0:test
[INFO]
| | ± org.seleniumhq.selenium:selenium-support:jar:2.41.0:test
[INFO]
| | - org.webbitserver:webbit:jar:0.4.14:test
[INFO]
| | - io.netty:netty:jar:3.5.2.Final:test
[INFO]
| - org.seleniumhq.selenium:selenium-remote-driver:jar:2.41.0:test
[INFO]
| ± cglib:cglib-nodep:jar:2.1_3:test
[INFO]
| ± org.json:json:jar:20080701:test
[INFO]
| ± org.seleniumhq.selenium:selenium-api:jar:2.41.0:test
[INFO]
| ± org.apache.httpcomponents:httpclient:jar:4.5.1:test
[INFO]
| | ± org.apache.httpcomponents:httpcore:jar:4.4.4:test
[INFO]
| | ± commons-logging:commons-logging:jar:1.2:test
[INFO]
| | - commons-codec:commons-codec:jar:1.9:test
[INFO]
| ± com.google.guava:guava:jar:18.0:test
[INFO]
| ± org.apache.commons:commons-exec:jar:1.1:test
[INFO]
| ± net.java.dev.jna:jna:jar:3.4.0:test
[INFO]
| - net.java.dev.jna:platform:jar:3.4.0:test
[INFO]
± com.vaadin:vaadin-spring-boot:jar:1.0.0:compile
[INFO]
| ± com.vaadin:vaadin-spring:jar:1.0.0:compile
[INFO]
| | - org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO]
| ± org.springframework.boot:spring-boot:jar:1.2.5.RELEASE:compile
[INFO]
| | - org.springframework:spring-context:jar:4.1.7.RELEASE:compile
[INFO]
| ± org.springframework.boot:spring-boot-autoconfigure:jar:1.2.5.RELEASE:compile
[INFO]
| | - org.yaml:snakeyaml:jar:1.14:compile
[INFO]
| - org.springframework:spring-webmvc:jar:4.1.7.RELEASE:compile
[INFO]
| ± org.springframework:spring-beans:jar:4.1.7.RELEASE:compile
[INFO]
| - org.springframework:spring-expression:jar:4.1.7.RELEASE:compile
[INFO]
± org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE:compile
[INFO]
| ± org.springframework.boot:spring-boot-starter:jar:1.2.5.RELEASE:compile
[INFO]
| ± com.fasterxml.jackson.core:jackson-databind:jar:2.4.6:compile
[INFO]
| | - com.fasterxml.jackson.core:jackson-annotations:jar:2.4.6:compile
[INFO]
| ± org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO]
| | ± org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO]
| | - com.fasterxml:classmate:jar:1.0.0:compile
[INFO]
| - org.springframework:spring-web:jar:4.1.7.RELEASE:compile
[INFO]
| - org.springframework:spring-aop:jar:4.1.7.RELEASE:compile
[INFO]
| - aopalliance:aopalliance:jar:1.0:compile
[INFO]
± org.springframework.boot:spring-boot-starter-jetty:jar:1.2.5.RELEASE:compile
[INFO]
| ± org.eclipse.jetty:jetty-jsp:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0:compile
[INFO]
| | ± javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO]
| | ± javax.servlet.jsp:javax.servlet.jsp-api:jar:2.3.1:compile
[INFO]
| | ± org.glassfish.web:javax.servlet.jsp:jar:2.3.2:compile
[INFO]
| | ± org.eclipse.jetty.orbit:javax.servlet.jsp.jstl:jar:1.2.0.v201105211821:compile
[INFO]
| | ± org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.2:compile
[INFO]
| | ± org.glassfish:javax.el:jar:3.0.0:compile
[INFO]
| | - org.eclipse.jetty.orbit:org.eclipse.jdt.core:jar:3.8.2.v20130121:compile
[INFO]
| ± org.eclipse.jetty:jetty-webapp:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty:jetty-xml:jar:9.2.11.v20150529:compile
[INFO]
| | | - org.eclipse.jetty:jetty-util:jar:9.2.11.v20150529:compile
[INFO]
| | - org.eclipse.jetty:jetty-servlet:jar:9.2.11.v20150529:compile
[INFO]
| | - org.eclipse.jetty:jetty-security:jar:9.2.11.v20150529:compile
[INFO]
| | - org.eclipse.jetty:jetty-server:jar:9.2.11.v20150529:compile
[INFO]
| ± org.eclipse.jetty.websocket:websocket-server:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty.websocket:websocket-common:jar:9.2.11.v20150529:compile
[INFO]
| | | ± org.eclipse.jetty.websocket:websocket-api:jar:9.2.11.v20150529:compile
[INFO]
| | | - org.eclipse.jetty:jetty-io:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty.websocket:websocket-client:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty.websocket:websocket-servlet:jar:9.2.11.v20150529:compile
[INFO]
| | - org.eclipse.jetty:jetty-http:jar:9.2.11.v20150529:compile
[INFO]
| - org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.2.11.v20150529:compile
[INFO]
| ± org.eclipse.jetty:jetty-annotations:jar:9.2.11.v20150529:compile
[INFO]
| | ± org.eclipse.jetty:jetty-plus:jar:9.2.11.v20150529:compile
[INFO]
| | | - org.eclipse.jetty:jetty-jndi:jar:9.2.11.v20150529:compile
[INFO]
| | ± javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO]
| | ± org.ow2.asm:asm:jar:5.0.1:compile
[INFO]
| | - org.ow2.asm:asm-commons:jar:5.0.1:compile
[INFO]
| | - org.ow2.asm:asm-tree:jar:5.0.1:compile
[INFO]
| ± org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.2.11.v20150529:compile
[INFO]
| - javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO]
± org.springframework.boot:spring-boot-starter-log4j:jar:1.2.5.RELEASE:compile
[INFO]
| ± org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO]
| ± org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO]
| ± org.slf4j:slf4j-log4j12:jar:1.7.12:compile
[INFO]
| - log4j:log4j:jar:1.2.17:compile
[INFO]
± org.springframework.boot:spring-boot-starter-actuator:jar:1.2.5.RELEASE:compile
[INFO]
| - org.springframework.boot:spring-boot-actuator:jar:1.2.5.RELEASE:compile
[INFO]
± com.vaadin:vaadin-themes:jar:7.6.3:compile
[INFO]
± com.vaadin:vaadin-push:jar:7.6.3:compile
[INFO]
| - com.vaadin.external.atmosphere:atmosphere-runtime:jar:2.2.7.vaadin1:compile
[INFO]
| - com.vaadin.external.slf4j:vaadin-slf4j-jdk14:jar:1.6.1:compile
[INFO]
± com.vaadin:vaadin-server:jar:7.6.3:compile
[INFO]
| ± com.vaadin:vaadin-sass-compiler:jar:0.9.13:compile
[INFO]
| | ± org.w3c.css:sac:jar:1.3:compile
[INFO]
| | ± com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO]
| | - com.yahoo.platform.yui:yuicompressor:jar:2.4.8:compile
[INFO]
| | - rhino:js:jar:1.7R2:compile
[INFO]
| ± com.vaadin:vaadin-shared:jar:7.6.3:compile
[INFO]
| | ± com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO]
| | - com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO]
| - org.jsoup:jsoup:jar:1.8.3:compile
[INFO]
± com.vaadin:vaadin-client-compiled:jar:7.6.3:compile
[INFO]
± javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO]
± cu.datys.gema.vaadin:gema-vaadin-module-core:jar:1.0.0-SNAPSHOT:compile
[INFO]
| ± cu.datys.gema.vaadin:gema-vaadin-core:jar:1.0.0-SNAPSHOT:compile
[INFO]
| ± org.vaadin.spring.addons:vaadin-spring-addon-i18n:jar:0.0.7.RELEASE:compile
[INFO]
| ± org.vaadin.spring.addons:vaadin-spring-addon-eventbus:jar:0.0.7.RELEASE:compile
[INFO]
| ± org.vaadin.spring.addons:vaadin-spring-addon-mvp:jar:0.0.7.RELEASE:compile
[INFO]
| ± org.vaadin.spring.addons:vaadin-spring-addon-sidebar:jar:0.0.7.RELEASE:compile
[INFO]
| ± org.vaadin.spring.extensions:vaadin-spring-ext-core:jar:0.0.7.RELEASE:compile
[INFO]
| ± org.vaadin.spring.extensions:vaadin-spring-ext-security:jar:0.0.7.RELEASE:compile
[INFO]
| | ± org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile
[INFO]
| | ± org.springframework.security:spring-security-config:jar:3.2.7.RELEASE:compile
[INFO]
| | - org.springframework.security:spring-security-web:jar:3.2.7.RELEASE:compile
[INFO]
| - org.vaadin.spring.extensions:vaadin-spring-ext-boot:jar:0.0.7.RELEASE:compile
[INFO]
± cu.datys.gema.vaadin:gema-vaadin-application-core:jar:1.0.0-SNAPSHOT:compile
[INFO]
- cu.datys.corpus:corpus-widgetset:jar:1.0.0-SNAPSHOT:compile
[INFO]


Application error…
11485 [main]
INFO org.openqa.selenium.phantomjs.PhantomJSDriverService - environment: {}
16673 [main]
INFO cu.datys.gema.vaadin.test.utils.SeleniumJsonRunner - get http://localhost:8888/corpus
18564 [qtp1795468466-15]
INFO com.vaadin.spring.server.SpringUIProvider - Checking the application context for Vaadin UIs
18567 [qtp1795468466-15]
INFO com.vaadin.spring.server.SpringUIProvider - Found Vaadin UI [cu.datys.corpus.CorpusUI]

20942 [qtp1795468466-15]
WARN org.eclipse.jetty.servlet.ServletHandler -
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.AssertionError
at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:224)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:295)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.vaadin.spring.http.HttpResponseFilter.doFilter(HttpResponseFilter.java:51)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:68)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.AssertionError
at com.vaadin.server.VaadinService.loadSession(VaadinService.java:1963)
at com.vaadin.server.VaadinSession.getForSession(VaadinSession.java:447)
at org.vaadin.spring.security.managed.SecurityContextVaadinRequestListener.onRequestStart(SecurityContextVaadinRequestListener.java:56)
at org.vaadin.spring.servlet.Vaadin4SpringServletService.requestStart(Vaadin4SpringServletService.java:65)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1398)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:364)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:595)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:156)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:72)
at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:128)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:146)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
… 44 more
22429 [main]
INFO cu.datys.gema.vaadin.test.utils.SeleniumJsonRunner - setElementText id user.login user
35531 [main]
ERROR cu.datys.gema.vaadin.test.utils.SeleniumJsonRunner - Error ejecutando test, guardando captura en target/selenium/login
org.openqa.selenium.NoSuchElementException: {“errorMessage”:“Unable to find element with id ‘user.login’”,“request”:{“headers”:{“Accept”:“application/json, image/png”,“Connection”:“Keep-Alive”,“Content-Length”:“35”,“Content-Type”:“application/json; charset=utf-8”,“Host”:“localhost:10994”},“httpVersion”:“1.1”,“method”:“POST”,“post”:“{"using":"id","value":"user.login"}”,“url”:“/element”,“urlParsed”:{“anchor”:“”,“query”:“”,“file”:“element”,“directory”:“/”,“path”:“/element”,“relative”:“/element”,“port”:“”,“host”:“”,“password”:“”,“user”:“”,“userInfo”:“”,“authority”:“”,“protocol”:“”,“source”:“/element”,“queryKey”:{},“chunks”:[“element”]
},“urlOriginal”:“/session/65160d40-e23b-11e5-b4e1-d332745c0bf5/element”}}
Command duration or timeout: 12.71 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: ‘2.41.0’, revision: ‘3192d8a6c4449dc285928ba024779344f5423c58’, time: ‘2014-03-27 11:29:39’
System info: host: ‘pc-hlicea’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.2.0-32-generic’, java.version: ‘1.8.0_66-internal’
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver