I’m trying to add a long multi-line text (20,000+ characters) into Tinymce textarea.
setText works but it takes too long to simulate typing.
WebUI.setText(findTestObject(‘iframebody’), article)
This is my code:
WebElement element = WebUiCommonHelper.findWebElement(findTestObject(‘iframebody’),30)
WebUI.executeJavaScript(“arguments[0].append('” + article+ “');”, Arrays.asList(element))
Unable to execute JavaScript. (Root cause: org.openqa.selenium.WebDriverException: unknown error: Runtime.evaluate threw exception: SyntaxError: Invalid or unexpected token
So may be I need something like this
WebUI.executeJavaScript(“arguments[0].append(''arguments[1]);”, Arrays.asList(element))