Hi Nick,
From my experience I can tell you that element being off screen should not cause you any problems when calling click() because the browser will scroll the element into view before clicking it. Most common issues that cause click() to have no effect are:
- other elements overlying the clicked element
- various animations which cause the click not to happen on the target element because things are moving when the click happens
- interacting with a select whose dropdown overlays the clicked element before clicking it
Some browsers tend to throw exceptions in such cases while others silently continue even though the element has not been clicked. I would therefore suggest reinvestigating the cause of your failures.
Back to your original questions, to pass a DOM element to a js call you need to pass a WebElement instance to a JavascriptInterface.exec() call and then reference it via the arguments array in javascript. There's a couple methods that give you WebElement(s) of a Navigator (look for methods returning WebElement instances in javadocs for Navigator at
http://www.gebish.org/manual/current/api/geb/navigator/Navigator.html), singleElement() being one of them. Following is an example of passing a DOM element to a js call in Geb:
js.exec(singlesButton.singleElement, '"""