Katalon throwing WebDriverException after switching to WebView and selecting a dropdown.

Hi I want to select option from dropdown in android app. But after switching to webview katlon throwing below error:

Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: unknown error: unhandled inspector error: {"code":-32000,"message":"Promise was collected"}

Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to select option by label 'High' of object 'Object Repository/Fingertip ORs/Work Execution/My Work/Create Work Order/Webview/drd_Priority' 
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
	at com.kms.katalon.core.webui.keyword.builtin.SelectOptionByLabelKeyword.selectOptionByLabel(SelectOptionByLabelKeyword.groovy:98)
	at com.kms.katalon.core.webui.keyword.builtin.SelectOptionByLabelKeyword.execute(SelectOptionByLabelKeyword.groovy:71)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.selectOptionByLabel(WebUiBuiltInKeywords.groovy:1230)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$selectOptionByLabel.call(Unknown Source)
	at 80885-Work order_Test Case to edit Wok Order in Fingertip device in Assignment mode with edit work Order SigOption enabled-FT.run(80885-Work order_Test Case to edit Wok Order in Fingertip device in Assignment mode with edit work Order SigOption enabled-FT:38)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1697708374346.run(TempTestCase1697708374346.groovy:25)
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: unknown error: unhandled inspector error: {"code":-32000,"message":"Promise was collected"}

Hi,

Thank you for sharing your issue with community. I found this similar thread that expects to help you: Unable to Select an option from the dropdown : Error : Element should have been "select" but was "div" - #2 by grylion54

hi @jyotisagar.mohapatra

“unhandled inspector error: Promise was collected” is not a locator problem, it comes from chromedriver talking to the webview over devtools and losing the page it was evaluating in. two things cause it in my experience:

the chromedriver appium picked does not match the android system webview / chrome version on the device. check the webview version in settings > apps > android system webview, and either set chromedriverAutodownload: true in the appium server args or point chromedriverExecutable at the matching build. the mismatch works for simple clicks and then explodes on anything that runs script, selectOptionByLabel is one of those.

the webview reloads or navigates while the select is happening (single page apps do this on focus). add WebUI.waitForElementClickable on the select, and if the dropdown is a custom widget rather than a real <select>, pick it in native context instead: Mobile.switchToNative(), Mobile.tap the field, then tap the option text.

if you only need the value set, WebUI.executeJavaScript("arguments[0].value='High'; arguments[0].dispatchEvent(new Event('change',{bubbles:true}))", [el]) sidesteps the select keyword entirely.