Cannot click mobile button in web app

Hi,

I’m trying to run a simple mobile test that just clicks on a button in a web application. However I keep getting the following error:

java.lang.ClassCastException: java.util.HashMap cannot be cast to org.openqa.selenium.WebElement

This is the test script

def void setValue(TestObject object, String valueToSet){
valueToSet = valueToSet.toUpperCase()
ArrayList elements = findWebElements(object, 10)
for(element in elements){
if(element.getAttribute(“value”).equals(valueToSet)){
element.click()
}
}
}

It is the findWebElement(object, 10) that is throwing the error. This is the stacktrace

at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:409)
at io.appium.java_client.DefaultGenericMobileDriver.findElements(DefaultGenericMobileDriver.java:54)
at io.appium.java_client.AppiumDriver.findElements(AppiumDriver.java:149)
at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:476)
at io.appium.java_client.DefaultGenericMobileDriver.findElementsByXPath(DefaultGenericMobileDriver.java:144)
at io.appium.java_client.AppiumDriver.findElementsByXPath(AppiumDriver.java:181)
at org.openqa.selenium.By$ByXPath.findElements(By.java:356)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:358)
at io.appium.java_client.DefaultGenericMobileDriver.findElements(DefaultGenericMobileDriver.java:50)
at io.appium.java_client.AppiumDriver.findElements(AppiumDriver.java:145)
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElements(WebUiCommonHelper.java:754)
at com.kms.katalon.core.webui.common.WebUiCommonHelper$findWebElements.callStatic(Unknown Source)

I don’t get why this error is happening. This happens even when I used findWebElement and give it it a specific element. I’ve tried using javascript and the tap() method.

Seems like something in AppiumDriver, does anyone know how to fix?

Katalon version: 6.1.0
Appium: 1.12.1

@ganish.toolsie Version 6.1.0 only support Appium 1.8.1 or ealier. Please update to version v6.2.0 or later.