I tried to set text of field with following code, with use of setText()
method:
WebUI.setText(findTestObject('Object Repository/myobj121'), findTestData('mydbfile').getValue('c10', i))
It reads textual data from given file, but I got error message:
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
After that I tried to use executeJavaScript()
method:
WebElement element = WebUiCommonHelper.findWebElement(findTestObject('Object Repository/myobj121'),30)
WebUI.executeJavaScript("arguments[0].setAttribute('value','" + findTestData('mydbfile').getValue('c10', i) + "')")
It gives following error message:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.executeJavaScript() is applicable for argument types: (java.lang.String) values: [arguments[0].setAttribute(‘value’,‘MyValue1’)]