# How do I put a line break here?

**URL:** <https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609>\
**Category:** Web Testing\
**Tags:** katalon-recorder\
**Created:** [March 6, 2019, 11:22am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609 "2019-03-06T11:22:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hb7of9](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hb7of9/32/2378_2.png) [@hb7of9](https://forum.katalon.com/u/hb7of9)\
**Post date:** [March 6, 2019, 11:22am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/1 "2019-03-06T11:22:22Z")

</div>

> ${awsId},/n ${awsId},

Where the “/n” is?

---

<div class="post-metadata">

**Author:** ![Mark\_Gibson](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mark_gibson/32/1143_2.png) [@Mark\_Gibson](https://forum.katalon.com/u/Mark_Gibson)\
**Post date:** [March 7, 2019, 9:01am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/2 "2019-03-07T09:01:12Z")

</div>

Could you provide more details of what you are trying to achieve?  
I.e. are you trying to use the `echo` command to ouput in Katalon’s log?  
Or are you trying to output something into a text field in your application under test?

---

<div class="post-metadata">

**Author:** ![hb7of9](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hb7of9/32/2378_2.png) [@hb7of9](https://forum.katalon.com/u/hb7of9)\
**Post date:** [March 7, 2019, 9:18am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/3 "2019-03-07T09:18:12Z")

</div>

Hi Mark,  
I am trying to type something into a text box. It should have link breaks between the things I am trying to type.

---

<div class="post-metadata">

**Author:** ![Mark\_Gibson](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mark_gibson/32/1143_2.png) [@Mark\_Gibson](https://forum.katalon.com/u/Mark_Gibson)\
**Post date:** [March 7, 2019, 9:53am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/4 "2019-03-07T09:53:34Z")

</div>

Here’s one way of doing it

```auto
open | https://katalon-test.s3.amazonaws.com/demo-aut/dist/html/form.html | |
store | First Line | firstLine |
store | Second Line | secondLine |
storeEval | firstLine + "\n" + secondLine | lines |
click | id=comment | |
type | id=comment | ${lines} |

```

which, for me, results in  
 ![newlines](https://europe1.discourse-cdn.com/katalon/original/2X/8/827f07cbb37dac019d127933a94c7a0b132a56ba.png)

The key command here is `storeEval` which evaluates a JavaScript snippet, in this case concatenating the lines and a newline character.

---

<div class="post-metadata">

**Author:** ![hb7of9](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hb7of9/32/2378_2.png) [@hb7of9](https://forum.katalon.com/u/hb7of9)\
**Post date:** [March 7, 2019, 10:52am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/5 "2019-03-07T10:52:19Z")

</div>

Interesting so yo first you store it and then concatenate it later

That’s super spiffy but wowee – so complicated – is there not a way to just and a line break in an easier way

${var} LINE\_\_\_\_BREAK ${var} kantu uses \n for this

---

<div class="post-metadata">

**Author:** ![Mark\_Gibson](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mark_gibson/32/1143_2.png) [@Mark\_Gibson](https://forum.katalon.com/u/Mark_Gibson)\
**Post date:** [March 7, 2019, 11:12am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/6 "2019-03-07T11:12:22Z")

</div>

That was just something off the top of my head.

However, after a bit more research, I’ve found the combination of `sendKeys` and `${KEY_ENTER}` does the trick

If you add this to my example above, it will add a third line

```auto
sendKeys | id=comment | ${KEY_ENTER}Third Line |

```

From the reference for **sendKeys**

> Simulates keystroke events on the specified element, as though you typed the value key-by-key.
> 
> For special keys (e.g. ${KEY\_ENTER}, ${KEY\_SHIFT}, etc.), only Chrome version of the extension is supported. Keys combinations (e.g. Ctrl-A) are not supported at this moment.
> 
> This simulates a real user typing every character in the specified string; it is also bound by the limitations of a real user, like not being able to type into a invisible or read only elements. This is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
> 
> Unlike the simple “type” command, which forces the specified value into the page directly, this command will not replace the existing content. If you want to replace the existing contents, you need to use the simple “type” command to set the value of the field to empty string to clear the field and then the “sendKeys” command to send the keystroke for what you want to type.

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [November 24, 2020, 7:53am UTC](https://forum.katalon.com/t/how-do-i-put-a-line-break-here/20609/7 "2020-11-24T07:53:35Z")

</div>

3 posts were split to a new topic: [How to print the logs in new line](https://forum.katalon.com/t/how-to-print-the-logs-in-new-line/49523)
