Chromium with GebReportingSpec fails with groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method #292

geb-bot opened this Issue Mar 11, 2014 · 5 comments


None yet

2 participants

geb-bot commented Mar 11, 2014

Originally created by Lee Davis.

Ubuntu 13.10 - 3.11.0-18-generic
Java Version - 1.7.0_51
Grails 2.3.7

Testing a custom build of chromium, with chromedriver 2.9/selenium-chrome-driver:2.40.0

Running spec extending GebSpec everything works as expected, but as soon as I extend GebReportingSpec and run the same spec, I receive the following error:
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39)

geb-bot commented Mar 12, 2014

Originally posted by Lee Davis.

Curious if there is anything related to this issue noted on stacktrace with NULL and method overloading?

It's a (somewhat little-known) oddity of Groovy's multi-dispatch mechanism, which as attempting to invoke the "most appropriate" method, in combination with the fact that the provided static type (in your case A or B) is not used as part of the dispatch mechanism. When you declare A a = null, what you get is not a null reference of type A, but a reference to NullObject.

Ultimately, to safely handle possibly null parameters to overloaded methods, the caller must cast the argument, as in

A a = null
assert'foo', a as A) == 'a'

geb-bot commented Mar 13, 2014

Originally posted by Lee Davis.
Changing the following line:
decoded = Base64.decode(rawBase64)
decoded = Base64.decode(rawBase64 as String)
...fixes the problem, but I run into another issue where screenshots fail and I get the error, "Unable to receive message from renderer"
org.openqa.selenium.WebDriverException: chrome not reachable
(Session info: chrome=content shell)
(Driver info: chromedriver=2.9.248304,platform=Linux 3.11.0-18-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2 milliseconds
Build info: version: '2.40.0', revision: '4c5c0568b004f67810ee41c459549aa4b09c651e', time: '2014-02-19 11:13:01'
System info: host: 'UBUNTU-13-GNOME-01', ip: '', 'Linux', os.arch: 'amd64', os.version: '3.11.0-18-generic', java.version: '1.7.0_51'
Session ID: ea5b688f6e5aa7d1cb9759f259871eb5
Driver info:
Capabilities [{platform=ANY, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={}, rotatable=false, locationContextEnabled=true, version=content shell, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.getCurrentUrl(
at com.drc.test.LoginPage._clinit__closure1(LoginPage.groovy:9)
at com.drc.test.LoginPage._clinit__closure1(LoginPage.groovy)
at geb.Page.verifyThisPageAtOnly(Page.groovy:165)
at geb.Page.verifyAt(Page.groovy:133)
at geb.Browser.doAt(Browser.groovy:358)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at com.drc.test.FooBarSpec.Can Login with Math99_closure2(FooBarSpec.groovy:37)
at com.drc.test.FooBarSpec.Can Login with Math99_closure2(FooBarSpec.groovy)
at geb.waiting.Wait.waitFor(Wait.groovy:117)
... 6 more

geb-bot commented Mar 17, 2014

Originally posted by Luke Daley.

Thanks for the thorough report. We'll get this fixed.

geb-bot commented Mar 17, 2014

Originally posted by Lee Davis.

Thanks Luke! Besides the problem listed above with the Base64 decoding, there appears to be a limitation with CEF3.1650 and earlier that breaks browser reporting used by GebReportingSpec . This has been addressed is CEF3.1750 and later. Also with CEF3.1750 and later it never hits the "NULL" scenario of determineScreenshotDriver, which appears to only happen if there is a bigger problem. Regardless, it would be great to not to barf at this point. Cheers Lee.

geb-bot commented Jan 17, 2015


@geb-bot geb-bot added the Bug label Apr 12, 2015
@erdi erdi was assigned by geb-bot Apr 12, 2015
@geb-bot geb-bot added this to the 0.10.1 milestone Apr 12, 2015
@geb-bot geb-bot closed this Apr 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment