1

This is my eggplant script

if iFound does not contain "NULL" then
    //replace "\n" by " & return & " in iFound
    replace every occurrence of "\n" in iFound with " & return & "

    log "before clicking see text" && iFound
    log "not null and clicking"
    click iFound
End if

Here my parameter iFound is holding "Cadbury Creme Egg\nMcFlurry"

I want to replace "Cadbury Creme Egg\nMcFlurry" like "Cadbury Creme Egg & return & McFlurry"

Hence I have written the replace command but it is ignoring the escape character "\n"

replace every occurrence of "\n" in iFound with " & return & "

How can I do the replace of "\n" newline character with " & return & "

Prasad Madge
  • 71
  • 1
  • 14

1 Answers1

3

Normally, when you encounter the \n or \t characters in your log window or run window it's actually already the CRLF or TAB character. The \n is used in the log display because multi-line display doesn't work very well in the scrolling text.

If you save that string into a file, you should see that those two characters come through correctly.

You can also turn on escape characters for the IDE (so that \n is interpreted the same as return) under the Eggplant --> Preferences --> Run --> Keyboard menu as an "Enable backslash escape codes" checkbox.

Warren.
  • 41
  • 3