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.
CSV file reading in incorrectly
Hi,
I am running a script to input text from a csv file into my program.
I am getting this to work however the only field getting written to is the first field. I need to know how to get the text in the csv file to write to the next available text box & so on.
Code:
var $data = _readCSVFile("data.csv");
_dataDrive(editData, $data);
function editData($one, $two, $three)
{
_setValue(_textbox("textbox1"), $one);
_setValue(_textbox("textbox2"), $two);
_setValue(_textbox("textbox3"), $three);
}
I have a feeling I am missing something simple. Any ideas? Thanks.
Comp: Windows XP Pro 2002 SP3
Browser: Firefox 4.0
Sahi: V3.5
I am running a script to input text from a csv file into my program.
I am getting this to work however the only field getting written to is the first field. I need to know how to get the text in the csv file to write to the next available text box & so on.
Code:
var $data = _readCSVFile("data.csv");
_dataDrive(editData, $data);
function editData($one, $two, $three)
{
_setValue(_textbox("textbox1"), $one);
_setValue(_textbox("textbox2"), $two);
_setValue(_textbox("textbox3"), $three);
}
I have a feeling I am missing something simple. Any ideas? Thanks.
Comp: Windows XP Pro 2002 SP3
Browser: Firefox 4.0
Sahi: V3.5
Comments
This looks correct. Can you show your csv file too? Which OS are you on?
Regards,
Narayan
Sorry I don't know how to attach the csv file.
The csv file is basically a list, ie:
Green
Red
Blue
Regards,
mac
Your code will work on transposing your data column
i.e,
Green
Red
Blue
changes to
Green, Red, Blue
Regards,
dkulkarni
Thank you Dkulkarni & Narayan. This has worked. Apologies, I had took it for granted that the csv file was read in by column & not by row.
My first sript works!
Regards,
mac