Need suggestion for my code

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘[[[CChromeDriver: chrome on MAC (84d0a371b64916993b26560cb564d909)] → xpath: //label[@id=‘file-drag’]], [[CChromeDriver: chrome on MAC (84d0a371b64916993b26560cb564d909)] → xpath: //label[@id=‘file-drag’]]]’ with class ‘java.util.ArrayList’ to class ‘com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords’ due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords($EventFiringWebElement,$EventFiringWebElement)

My code is below

/WebUI element = WebUiCommonHelper.findWebElements(findTestObject(‘label_Drag Drop a csv or an Excel file here’), 30)
WebUI.executeJavaScript(‘arguments[0].style.display=‘block’’, Arrays.asList(element))

can you please let me know what is wrong here?

as noted in the other post.
findWebElements is a functions that returns a list of WebElements
you are trying to assign that list to a variable that is supposed to be WebUI, which is not a list, and not even a WebElement for that matter, WebUI is short for WebUiBuiltInKeywords, usually imported as such

1 Like

You have made a dual post:

So I would close this one.

1 Like