private Method getDeclaredMethod(String name) {
    Preconditions.checkNotNull(name);

    Method method = null;
    try {
      method = getView().getClass().getMethod(name);
    } catch (NoSuchMethodException e) {
      // can happen
    }
    return method;
  }
Unconventional way of adding a Javascript interface but the main reason why I took this way
is that it is working stable compared to the webview.addJavascriptInterface way.
selendroid-server/src/main/java/io/selendroid/server/model/AndroidNativeElement.java