@Override
  public boolean isSelected() {
    if (getView() instanceof CompoundButton) {
      return ((CompoundButton) getView()).isChecked();
    }

    throw new UnsupportedOperationException(
        "Is selected is only available for view class CheckBox and RadioButton.");
  }
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