WYSIWYG editor - Error on

I am trying to enter text into a WYSIWYG editor but it is failing on recognising the object (i think!).

the error im getting is:
Unable to set text ‘this is the response’ of object ‘Object Repository/Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘this is the response’ of object ‘Object Repository/Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’
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.SetTextKeyword.setText(SetTextKeyword.groovy:66)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText.call(Unknown Source)
at Create Intent.run(Create Intent:39)
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:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1563813048719.run(TempTestCase1563813048719.groovy:21)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’ located by ‘By.cssSelector: angular-editor-textarea#ng-reflect-model’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1097)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.doCall(SetTextKeyword.groovy:51)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.call(SetTextKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:66)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText.call(Unknown Source)
at Script1562237217316.run(Script1562237217316.groovy:39)
… 11 more
)

Correct. The above mentioned ObjectRepository TestObject was not found. You should check the css works in the browser console.

Aside: if you’re working with an element’s ID, you don’t need anything else, this will work (assuming it exists):

#ng-reflect-model

So, do i use #ng-reflect-model in the css ? It does exist, its an attribute if the class angular editor-textarea.

Yes. But Katalon is saying it cannot find that element. Did you wait for it to become visible? Sometimes elements are created after the page has loaded.

1 Like

Hi Russ,
I added code to wait for element: and then enter text

WebUI.waitForElementVisible(findTestObject(‘Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’), 30)

’ Enters text in the Response Field (HTML Editor)’
WebUI.setText(findTestObject(‘Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’), ‘this is the response’)

used: #ng-reflect-model in CSS. but its still failing:

Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Create Intent Page/Intent Page/div_Response (Standard)_angular-editor-textarea’ located by ‘By.cssSelector: #ng-reflect-model’ not found
at

Hi @salia.gul

Can you provide the screenshot of the HTML of the textarea ? It’d give us more clues as to why the element is not being found.

Cheers !

hey, its ok, i found the solution. I copied the XPath of the control to the object and it worked. It didn’t like the #ng-reflect-model’ not found. Thanks for your help :slight_smile: