Enter a long multi-line text

Hi,

Was struggling with the same today to add next lines in a textarea. Ended up creating a custom keyword which changes ‘\n’ from the input string to shift+enter keys too simulate the next line, hope this helps.

The custom keyword:

/**
* Set the text of a textarea, next line with '\n'.
* @param testObject Katalon test object.
* @param text Text to add too the textarea.
*/
@Keyword
def SetTextArea(TestObject testObject, String text) {
if(text.contains("\\n")){
text = text.replace("\\n", Keys.chord(Keys.SHIFT, Keys.ENTER))
}
else{
text = text.replace("\n", Keys.chord(Keys.SHIFT, Keys.ENTER))
}

WebUI.sendKeys(testObject, text)
}

Details about custom keywords: https://www.katalon.com/resources-center/tutorials/advanced/create-custom-keyword/