Hi,
We can’t create test case to write inside Redactor editor. Both using recorder and web spy, it will record div_ as object. Can’t adding setText to the object.
Any solution? Please help

Hi,
We can’t create test case to write inside Redactor editor. Both using recorder and web spy, it will record div_ as object. Can’t adding setText to the object.
Any solution? Please help

Hello,
you will probably need something like this:
driver.executeScript("arguments[0].innerHTML = arguments[1]", element, text);
Could you please give me an example code for this case in Katalon?
i’m writing this from head so errors will occure
after openBrowser() and navigateTo()
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(objectToWriteTo, 5);
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].innerHTML = arguments[1]", objectToWriteTo, "text writen to div element");
greeting from TC
this is what works on this page:
//Open browser
WebUI.openBrowser("http://forum.katalon.com/discussion/7659/how-to-create-test-case-to-write-text-into-redactor-editor#latest")
WebUI.scrollToElement(findTestObject('Object Repository/editor'), 3)
WebUI.click(findTestObject('Object Repository/editor'))
WebUI.sendKeys(findTestObject('Object Repository/editor'), "greeting from TC")

Hi,
we still get error after run the test case. Any solution for this?
Thanks anyway, really appreciate for your help
add imports
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.testng.Assert
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webui.common.WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory
Hello Andrej,
for ‘Greeting from TC’ test case, do you create Object repository manually? Could you show me object repository for editor?

We still unable to send keys to the object
Thanks
Hello Rizky,
i defined 2 objects : inner frame and then editor itself
iframe under name editorIframe:

editor as editor:

please pay attention to Parent iframe settings
can you send us html of element you are trying to interact with? it’s possible that actions that cover interaction with object are on other level. You need to find object that have defined event listeners to process keyboard inputs. on this page it’s //iframe//body element :

hello,
testObject will be defined as //textarea[@id=“Projects_description”]
and i’ll go with WebUI.sendKeys(testObject, “text to display”)
wanted to let you know that i used what you gave here as an answer and it worked for me after struggling with rich text field. thank you
Hi there,
Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.
Thanks!