18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Error while inserting newline "\n" in a textarea

sebhuetsebhuet Members
edited November 2010 in Sahi - Open Source
Hi,

I am using sahi last build and chrome and automate a web site via java.
I have a textarea called "message" i would like to fill with text containing carrier return \r\n.

ElementStub ta = browser.textarea("message");
ta.setValue("a\nb");

this leads to error invalid token.

How may i handle newlines ?

Thanks in advance.

Seb

Error msg is error:_setValue(_textarea("message"), "a
b")
SyntaxError: Unexpected token ILLEGAL
SyntaxError: Unexpected token ILLEGAL
at [object Object].ex "sitesitesite" /_s_/spr/concat.js:2762:9)
at unknown source

Comments

  • Hi sahi team,
    Is there any solution for this problem?!
    I am using sahi-v3 and have it too and need urgent your advice. Thanks!
    Is it a problem of sahi-v3? Have you soved it already in sahi-v35?
  • narayannarayan Administrators
    This has been fixed in Sahi V3.5
  • I tried it with chromium with the controller, "\t" is working but "\n" isn't. Got the V3.5
  • sebhuetsebhuet Members
    up up
    Sorry this does not look to be fixed.
  • SumitraSumitra Members
    Hi sebhuet,

    This has been fixed in Sahi V3.5

    The usage of this is :

    browser.textarea("ta1").setValue("a\nb");

    Regards
    Sumitra
Sign In or Register to comment.