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 get data in excel using _getExcel
Hi Sahi Team,
I'm using the latest version of Sahi (v4.2), and i get across _getExcel() in the documentation.
Is it possible?
Thanks and regards.
I'm using the latest version of Sahi (v4.2), and i get across _getExcel() in the documentation.
//Set Data
var $excel = _getExcel("C:\\poiTest.xls","Sheet1");
var $excelData=[
["ajay","babu","cheeran"],
["david","elango","frank"],
["gokul","hari","irfan"],
["jo","kumar","latha"],
["mani","naraen","ojha"],
["peter","queen","richard"],
["shalini","thomas","umesh"]
];
$excel.setData($excelData);
var $data=$excel.getData();
_assertEqual("elango",$data[1][1],"Values are Equal");
//Get Data
var $getdata=$excel.getData();
_assertEqual("irfan",$getdata[2][2],"Values are Equal");
I didn't find any example in getting the data from an excel.Is it possible?
Thanks and regards.
Comments
var $data=$excel.getData();
is getting back the data from the Excel sheet!
Regards,
Narayan
Okay, got that.
In _getExcel(), how can i implement a specific select?
Thanks and regards.
I am using Sahi Pro 4.3.2
I have a 9 digit number in excelsheet. which i am trying to access in my script.
The number in excel sheet is 900000001. But when i try to get this value in script using following code.
$gstrReferNo = $excel.get(1, 1);
It returns value as "9.10000001E8"
do we need to format the values before we could use them ? or is there any better way where i could get the values in same format which i stored in excel sheet
Thank you,
Vaibhav
Hi Vaibhav,
Could you try putting a single quote on your data?
i.e. '900000001
'Cause that's how we solved this issue.
Regards.