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.

Newlines are not appending with writeFile/writeToFile

isreenivasisreenivas Members
edited November -1 in Sahi - Open Source
I'm trying to write some output data with the help of writeFile or writeToFile, but problem is I couldn't able to insert newline characters and everything is writing into single line continusouly. I tried with \n and/or \r. What's way of writing newlines with these functions?

Pl help.

Comments

  • narayannarayan Administrators
    The normal way on windows would be

    var $s = "line1\r\nline2";
    _writeFile($s);

    If you just use \n, it may not look correct in editors like notepad.
Sign In or Register to comment.