Error using withAlert - No signature of method: geb.navigator.NonEmptyNavigator.getJs()

1,463 views
Skip to first unread message

Dustin Sawatzky

unread,
Apr 3, 2018, 4:22:19 PM4/3/18
to Geb User Mailing List
Hey,

I'm trying to use the withAlert block to dismiss an alert, but it doesn't seem to be working. Just invoking withAlert is causing an error in the DefaultAlertAndConfirmSupport class. Here is the error:


  (Session info: chrome=65.0.3325.181)
  (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.4 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'OSX-A1G8WM', ip: 'fe80:0:0:0:18eb:50cd:deb3:f656%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_77'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=MAC, acceptSslCerts=false, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=MAC, setWindowRect=true, unexpectedAlertBehaviour=ignore, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef), userDataDir=/var/folders/wh/qtg_28g117v905f94sd7zdc1k2z9x8/T/.org.chromium.Chromium.z9yEI6}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=ignore, databaseEnabled=false, handlesAlerts=true, version=65.0.3325.181, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]

Caused by: groovy.lang.MissingMethodException: No signature of method: geb.navigator.NonEmptyNavigator.getJs() is applicable for argument types: () values: []
Possible solutions: getX(), getY(), getX(), getY(), getAt(groovy.lang.EmptyRange), getAt(groovy.lang.Range)
    at geb.navigator.NonEmptyNavigator.methodMissing(NonEmptyNavigator.groovy:568)
    at geb.content.PageContentSupport.methodMissing(PageContentSupport.groovy:33)
    at geb.Page.methodMissing(Page.groovy:112)
    at geb.Page.init_closure1(Page.groovy:151)
    at geb.Page.init_closure1(Page.groovy)
    at geb.js.DefaultAlertAndConfirmSupport.getJavascriptInterface(DefaultAlertAndConfirmSupport.groovy:32)
    at geb.js.DefaultAlertAndConfirmSupport.captureDialog(DefaultAlertAndConfirmSupport.groovy:112)
    at geb.js.DefaultAlertAndConfirmSupport.captureAlert(DefaultAlertAndConfirmSupport.groovy:138)
    at geb.js.DefaultAlertAndConfirmSupport.withAlert(DefaultAlertAndConfirmSupport.groovy:146)
    at geb.Page.withAlert(Page.groovy:130)
    at geb.Browser.methodMissing(Browser.groovy:209)
    at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
    ... 1 more

Is there anything that I'm missing to get this to work?

Thanks,
Dustin

Marcin Erdmann

unread,
Apr 3, 2018, 5:13:43 PM4/3/18
to Geb User Mailing List
Hi Dustin,

Looks like it might be a potential bug. Can you please confirm which version of Geb and Groovy you're running?

Thanks,
Marcin

--
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+unsubscribe@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/82daea87-8c13-41ca-96f6-3682e6232c78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcin Erdmann

unread,
Apr 3, 2018, 5:28:44 PM4/3/18
to Geb User Mailing List
I had a feeling I saw something like what you describe before. The symptoms are exactly as the ones I included in an issue filed agains 2.5.0-alpha-1: https://issues.apache.org/jira/browse/GROOVY-8201

Any chance you're on the bleeding edge and using a 2.5.x line version of Groovy?

Dustin Sawatzky

unread,
Apr 3, 2018, 5:34:10 PM4/3/18
to Geb User Mailing List
Yeah - you had it right. We were using 2.5.0-beta-2. Switching to 2.4.15 seems to solve the problem. Thanks for your help!
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.

Marcin Erdmann

unread,
Apr 3, 2018, 5:42:47 PM4/3/18
to Geb User Mailing List
Great, I'm glad I could help.

To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages