I have installed and run the test script “Fill a form with data from CSV file”. It works perfectly.
However, when I create similar scripts and upload my own CSV files I consistently get the following error:
[error] SyntaxError: Unexpected token b in JSON at position 0
The token, (“b” in the example above), is nearly always the first letter of the first word in the first column of the CSV file.
In an effort to diagnose my problem, I did a small experiment with the test script. I downloaded the data.csv file from the “Test Data” section then deleted it from Katalon. I then immediately re-uploaded the same file back into the Test Data section. After doing this, I got the same Syntax error (see above - but token was “i” in this case and position was “1”) and the test script failed.
Having failed the test script, I completely removed it and the associated test data and re-uploaded a new copy. This action restored the script to working order.
I have constructed csv files using google sheets and libreoffice - no difference. I’ve tried my Chromebook and my Windows PC - no difference. I’ve shut down all the other chrome extensions - no difference. I’ve tried an earlier version of Katalon Recorder (version no. escapes me at the moment but I believe it was one that was recommended on this forum) - no difference.
In summary, I’m uploading what appear to be perfectly good csv files that look exactly like the script example but I’m getting a consistent syntax error. And it’s also happening on the script example that comes with Katalon Recorder.
I’ve googled this problem but have not found anything that has helped me resolve this issue.
My Chrome browser version is 92.0.4515.157 and the Katalon Recorder version is 5.5.4.8
I would appreciate any help in solving this problem
Hi @gprint97
Can you provide me with the CSV file that’s related to this problem? I could not reproduce it from my side. I talked to another user who also encountered this issue some time back.
We have a version where we’re attempting to fix this issue. Can you please try it out and tell me if it works?
The new release did not work.
After I installed the new release, I downloaded the test script and it worked. I then downloaded the CSV file to my computer, deleted the file from the test script, then re-uploaded the CSV file. When I reran the script I got the error message again, specifically - [error] SyntaxError: Unexpected token i in JSON at position 1[data.zip|attachment]
I’ve attached the csv file which is the re-uplaod of the test script file data.csv.
(upload://lB1tEeEZTFWu8FAyMalBXoK41Bu.zip) (250 Bytes)
It seems like you didn’t upload the file successfully.
Have you tried to rename the file to include .csv
in its name? like data.csv
. Add it anyway even if the format is already CSV.
OK. I cannot send you the file data.csv file directly. It is not one of the formats your system accepts. I zipped the file (a format your system accepts) but when I upload the zipped file we get the corrupted mess. I don’t know where to go next.
To be clear, when I upload the csv file to Katalon, I am definitely uploading data.csv and it is the exact file in appearance and name that I downloaded from Katalon.
Is there another way I can send you the file?
Yes, please send it to thanhto@katalon.com!
@gprint97 There was a mistake with the package and I just updated the file in the Github link above. Can you download selenium-recorder-chrome.zip
and try that version again just to make sure?
YESSSS! That worked a charm.
Thank you for persevering with me on this one. After several hours of head scratching, it’s wonderful to get this working.
1 Like
You’re welcome. I’m always glad to help!