driver = "firefox"
baseNavigatorWaiting = true
atCheckWaiting = true
class LoginTest extends GebReportingTest {@Testvoid testLoginFailure() {to LoginPage$("form").username = "foo"// Omitted as it doesn't get past here}}
| Failure: testLoginFailure(LoginTest)| geb.waiting.WaitTimeoutException: condition did not pass in 5.0 seconds (failed with exception)at geb.waiting.Wait.waitFor(Wait.groovy:124)at geb.navigator.factory.BrowserBackedNavigatorFactory.getBase(BrowserBackedNavigatorFactory.groovy:39)at geb.content.NavigableSupport.getBase(NavigableSupport.groovy:31)at geb.content.NavigableSupport.$(NavigableSupport.groovy:63)at geb.content.PageContentTemplateFactoryDelegate.$(PageContentTemplateFactoryDelegate.groovy:118)at pages.LoginPage$__clinit__closure2_closure3.doCall(LoginPage.groovy:10)at geb.content.PageContentTemplate.invokeFactory(PageContentTemplate.groovy:97)at geb.content.PageContentTemplate$_create_closure1.doCall(PageContentTemplate.groovy:59)at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:82)at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:54)at geb.content.PageContentSupport.getContent(PageContentSupport.groovy:43)at geb.content.PageContentSupport.propertyMissing(PageContentSupport.groovy:59)at geb.Page.propertyMissing(Page.groovy:77)at pages.LoginPage.login(LoginPage.groovy:18)at geb.Browser.methodMissing(Browser.groovy:203)at geb.junit4.GebTest.methodMissing(GebTest.groovy:53)at LoginTest.testLoginFailure(LoginTest.groovy:11)Caused by: java.lang.NoClassDefFoundError: Could not initialize class geb.navigator.NonEmptyNavigatorat geb.navigator.factory.DefaultInnerNavigatorFactory.createNavigator(DefaultInnerNavigatorFactory.groovy:39)at geb.navigator.factory.AbstractNavigatorFactory.createFromWebElements(AbstractNavigatorFactory.groovy:43)at geb.navigator.factory.BrowserBackedNavigatorFactory.createBase(BrowserBackedNavigatorFactory.groovy:33)at geb.navigator.factory.BrowserBackedNavigatorFactory$_getBase_closure1.doCall(BrowserBackedNavigatorFactory.groovy:39)at geb.waiting.Wait.waitFor(Wait.groovy:113)... 16 more| Completed 1 functional test, 1 failed in 10988ms
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/313c8a24-84df-458f-ab25-026b772d0356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/f79v-oY9OBc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAJPZsWJo_Bt9AcPTPG1v_kXbweYHD0Gh0vt6e9_beLacJ12tSw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAOEjA_bbS2R8E2SP4Ks%3D0%2BjdhzDNTYyFndGbMzzXDDs22F6rcg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAB06vMCoRtTbL1NQ95e0Wumsgxx-66U36FVB69x%3D6cTcHJDuVg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAOEjA_aWFXVCrT%3D__nWp7aXmYfsO1XnqbQY2qJHc-kpRac7%3D6A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAB06vMBNo6QbjBoG8jprTkFMB074Qn6Hsu0TzngeU40KwqZNMg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CAJPZsWKQexQVW3FPTcCNpxQ9psMbQZsBMqkLz%2BJjy0RTgekChw%40mail.gmail.com.
import geb.junit4.GebReportingTestimport org.junit.Testimport pages.LoginPageclass LoginTest extends GebReportingTest {
@Testvoid testLoginFailure() {
to LoginPagepage.login("foo", "bar")assert at(LoginPage)assert loginMessage == "Please fill in required fields"
}
}
package pagesimport geb.Pageclass LoginPage extends Page {
static url = "/login"static at = { title == "Login" }static content = {
username { $("input", id: "idnumber") }password { $("input", id: "password") }loginButton { $("input", type: "submit") }loginMessage { $(".login_message").text() }
}void login(String idnumber, String pass) {
username.value(idnumber)password.value(pass)loginButton.click()
}
}
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for groovy.lang.DelegatingMetaClass do not match. Expected -1 but got 2at geb.navigator.AttributeAccessingMetaClass.<init>(AttributeAccessingMetaClass.groovy:24)at geb.transform.AttributeAccessingMetaClassRegistrar.registerFor(AttributeAccessingMetaClassRegistrar.groovy:22)at geb.navigator.NonEmptyNavigator.<clinit>(NonEmptyNavigator.groovy:42)
at geb.navigator.factory.DefaultInnerNavigatorFactory.createNavigator(DefaultInnerNavigatorFactory.groovy:39)at geb.navigator.factory.AbstractNavigatorFactory.createFromWebElements(AbstractNavigatorFactory.groovy:43)at geb.navigator.factory.BrowserBackedNavigatorFactory.createBase(BrowserBackedNavigatorFactory.groovy:33)
at geb.navigator.factory.BrowserBackedNavigatorFactory.getBase(BrowserBackedNavigatorFactory.groovy:39)at geb.content.NavigableSupport.getBase(NavigableSupport.groovy:31)
at geb.content.NavigableSupport.$(NavigableSupport.groovy:111)at geb.content.PageContentTemplateFactoryDelegate.$(PageContentTemplateFactoryDelegate.groovy:142)
at pages.LoginPage$__clinit__closure2_closure3.doCall(LoginPage.groovy:10)at geb.content.PageContentTemplate.invokeFactory(PageContentTemplate.groovy:97)at geb.content.PageContentTemplate$_create_closure1.doCall(PageContentTemplate.groovy:59)at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:82)at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:54)at geb.content.PageContentSupport.getContent(PageContentSupport.groovy:43)at geb.content.PageContentSupport.propertyMissing(PageContentSupport.groovy:59)at geb.Page.propertyMissing(Page.groovy:77)at pages.LoginPage.login(LoginPage.groovy:18)
at LoginTest.testLoginFailure(LoginTest.groovy:11)
Colin, Kenneth's code indeed fails with a wait timeout from within LoginPage.login() but if you look down the stacktrace you will notice that it is caused by a NoClassDefFoundError which is the real cause of the failure.There has to be indeed something dodgy going on with class loading there as Brian suggested because that class is part of geb-core and if geb-core wasn't on your classpath then you wouldn't even be able to navigate to pages let alone take reports which apparently works.Kenneth, can you please:- provide code for LoginPage as asked by Colin- provide the full stack trace, i.e without "... 16 more" at the end- try setting baseNavigatorWaiting to false and reporting what happens then because as far as I can see the NoClassDefFoundError is being thrown when waiting for the base navigator
P.s. Poor you, not only having to retrofit tests on a legacy project but also hitting a wall so early in the process...
On Wednesday, 7 October 2015, Colin Harrington <> wrote:
Kenneth,Based on your original stacktrace, it looks like the LoginPage.login() is waiting for an element that isn't there. Can you share the code for LoginPage too?My guess is that the something in the login page isn't resolving correctly.LoginPage.login(LoginPage.groovy:18)or line 10~ Colin
Colin Harrington
colin.ha...@gmail.com
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/a295cea2-e3dc-449a-9a14-ba2043265ef5%40googlegroups.com.
Kenneth,First of all thanks for providing responses to all of the questions we asked, it indeed might be useful for people who stumble upon this thread in the future.
Do I understand correctly that you're in an even worse place than I initially thought and have to use Java 6? Damn...
I believe that Geb has been compiled with Java 7 from around 0.9. Given that Java 6 EOL was February 2013 I think that it's fair for us to expect people to upgrade their jvm version if they want the latest version of the library.
We tried to keep Java 6 compatibility, for example by fixing https://github.com/geb/issues/issues/263. It looks like the failure in your case is caused by a core groovy class (groovy.lang.DelegatingMetaClass) so the strategy we used for 263 won't help here. I think that updating the groovy version used for 0.10.0 or the fact that you're using Groovy 2.4.5 (at least that what you said in your email, though I'm not sure if Grails 2.2.4 would even work with such a new version of Groovy; as far as I know Grails comes with groovy bundled in it so you actually might be running a completely different version than you'd think) to run your tests might be the cause why 0.9 line works for you but 0.10.0 doesn't. But in general, I don't see any value in supporting JDK6 anymore now that JDK7 is EOL.
WRT the behemoth of a stacktrace you provided: its an unfiltered one and not the full one I asked for, you can still see "... 503 more" at the end of it. Unfiltered stacktrace is of little value for us here but I'm pretty sure that if you provided the full stacktrace we would be able to see IncompatibleClassChangeError in it. So no, it doesn't get swallowed, you were just unfortunate enough for your stacktrace to be long enough for the real cause of the failure to be hidden in that last 16 frames of it...
Good luck with getting the coverage in!
And here shows how new I am to the JVM invocation dance. I have no idea how to get those last 503 lines out. If I can get it out I'd gladly update the gist to have that, and to increase the context for future readers.
I have to add that I feel very confident about the contributors we have in this corner of the ring. This first interaction with the community made all the difference to me!
I hope that in time I can also make a good contribution here, in one form or another.