Question: I know how to pass strings (e.g. from DOM text nodes) from JavaScript (inside an apps `WKWebView`) to Swift. 

What other types are supported? For instance, could I pass DOM elements inside `WKScriptMessage`?

Answer: 
You cannot avoid `WebDriverWait`. If you send a webdriver click command, webdriver will blindly assume that "element is clickable". You need to instruct webdriver to wait because your element is special and needs some synchronization before it can click on it. I don't think you need to do this for every other element. You can incorporate [ExpectedConditions](http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html) so that you can keep your code snippets manageable and small. So something like,

```
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.elementToBeClickable(By.id("foo"))).click();

```
The other option you can try other than clicking is hit enter on respective element, for that you can refer ID of that element.

`driver.findElement(By.id("elementid")).sendKeys(Keys.ENTER);`