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 we can use .xls file as a input file.
Till now i have used .txt files as a input file and its working fine.
Script I used:
var $fileContents = "" + _readFile("D:\\Testdata\\test.txt");
var $SEPARATOR = ","; // or "\t" for tab
var $data = new Array();
var $lines = $fileContents.replace(/\r/g, '').split("\n");
for (var $i=0; $i<$lines.length; $i++)
{
$data[$i] = $lines[$i].split($SEPARATOR);
$row = $data[$i];
_setValue(_textbox("factoryInfo.name"), $row[0]);
}
What I need to change in script for using excel file instead of text.
Script I used:
var $fileContents = "" + _readFile("D:\\Testdata\\test.txt");
var $SEPARATOR = ","; // or "\t" for tab
var $data = new Array();
var $lines = $fileContents.replace(/\r/g, '').split("\n");
for (var $i=0; $i<$lines.length; $i++)
{
$data[$i] = $lines[$i].split($SEPARATOR);
$row = $data[$i];
_setValue(_textbox("factoryInfo.name"), $row[0]);
}
What I need to change in script for using excel file instead of text.
Comments
Refer forum id: http://sahi.co.in/forums/viewtopic.php?id=684
It will surely resolve your problems.
Regards,
Ashvin.