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.
"missing ; before statement" in _readCSVFile method
Hi,
When my script executes the following line (obviously with a valid path):
var $timecard_details = _readCSVFile("C:/Users/.../timecard_details.csv");
The script stops on the line before, with this error:
SyntaxError: missing ; before statement at 15 Feb 2013 4:26:48 PM
This was working perfectly last week this time.
I know it has to be the _readCSVFile method, because if I narrowed it down by commenting out various bits of my script - when I comment out this line, it runs OK. As soon as I have the call to _readCSV, the script fails.
Since last week, I believe there has been a company-wide update to everybody's Java runtime.
Could that be it? How do I solve this?
When my script executes the following line (obviously with a valid path):
var $timecard_details = _readCSVFile("C:/Users/.../timecard_details.csv");
The script stops on the line before, with this error:
SyntaxError: missing ; before statement at 15 Feb 2013 4:26:48 PM
This was working perfectly last week this time.
I know it has to be the _readCSVFile method, because if I narrowed it down by commenting out various bits of my script - when I comment out this line, it runs OK. As soon as I have the call to _readCSV, the script fails.
Since last week, I believe there has been a company-wide update to everybody's Java runtime.
Could that be it? How do I solve this?
Answers
Project1 (DM-26942) Admin (53414; ; 13.06),Monday,"Call with Roshan RE ""long project name (DM-26942)"""
Project2 (DM-26942) Admin (53414; ; 13.06),Monday,"Scheduling ""long project name (DM-26942)"""
Project3 Admin (53250; ; 13.06),Wednesday,"Sync call with Ros, Roshan, Andrew"
I deleted all the double quotes.
Now my script works. I traced the error to lib.js, where _readCSVFile is defined. It has an if statement like this:
if (w.match(/^".*"$/)){
words[j] = eval(w);
}
the line that calls "eval" is where the problem occurs with the CSV file as I had it.
Pretty interesting; we had fixed this, and the code now (in both OS and Pro) is
if (w.match(/^".*"$/)){
//words[j] = eval(w);
words[j] = w.substring(1, w.length-1);
}
Which version are you using?
Regards,
Narayan