18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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
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
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
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?
Sorry this does not look to be fixed.
This has been fixed in Sahi V3.5
The usage of this is :
browser.textarea("ta1").setValue("a\nb");
Regards
Sumitra