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.
How to write a value in a specific cell in the .CSV file?
I have all my script names ordered in a column (in a .CSV file). After successful execution of the first script, I want my main script to write a value as 'Passed' in the next column (on the same row against my script name). Similarly, for subsequent rows.
ie, I am trying to create the overall test execution report for each scripts.
My .CSV should read as below with two columns as 'ScriptName' and 'ExecutionStatus'.
ScriptName ExecutionStatus
Script1.sah Success
Script2.sah Failure
Script3.sah Success
Currently, I am able to read my script name from the first column. After Script1 execution, how do make the main script to update the status in the next column, against the script name ?
Please help.
ie, I am trying to create the overall test execution report for each scripts.
My .CSV should read as below with two columns as 'ScriptName' and 'ExecutionStatus'.
ScriptName ExecutionStatus
Script1.sah Success
Script2.sah Failure
Script3.sah Success
Currently, I am able to read my script name from the first column. After Script1 execution, how do make the main script to update the status in the next column, against the script name ?
Please help.
Answers
we need to pass 2 dimensional array for "writeCSVFile()" method, below is the example code
array[$i][$j], $i represents row and $j represents column
Below is the code to write a data into specific cell of csv file, hope this code will help for u
For example, I want to write the text 'Success' in cell 'D1'. Similarly, my script should write specific values in the required column.
Please help.
This is still not answered completely. Please open up the loop.
Are you trying to answer my question? I guess this response to be a wrong post.
As gaveyom mentioned, you need to read the csv file into a 2D array, change the particular array item value and then write it back.
For example,
Having said this, Sahi Pro already has the ability to take a CSV file as a suite, execute it, and update the file along with a link to output.
Regards,
Narayan