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.

Read the content of a file

vivekmunnavivekmunna Members
edited August 2010 in Sahi - Open Source
Hi

I tried to read the content of a file by using below line

_readFile("C:\sahi_Latest\userdata\scripts\viv001.txt");

It throws this error :
JSERROR
Wrapped net.sf.sahi.util.FileNotFoundRuntimeException: java.io.FileNotFoundException: C:sahi_Latestuserdatascripts iv001.txt (The filename, directory name, or volume label syntax is incorrect) at Aug 3, 2010 6:29:02 PM

Please say how to rectify this error.

Comments

  • _readFile("C:/sahi_Latest/userdata/scripts/viv001.txt");
  • vivekmunnavivekmunna Members
    edited August 2010
    when i use this _readFile("C:/sahi_Latest/userdata/scripts/viv001.txt");

    Sahi is not considering this line and execute the remaining scripts and then say Playback success

    Script is not retrieved from viv001.txt
  • narayannarayan Administrators
    Hi Vivek,

    I think what you are looking for is _include, not _readFile.

    Please go through the documentation for these APIs to know more.

    http://sahi.co.in/w/_include
    http://sahi.co.in/w/_readFile

    Regards,
    Narayan
Sign In or Register to comment.