0

I am a beginner in Sahi Automation Tool.

I set the following changes to run my script.

1) In Sahi/Userdata/bin SET SAHI_EXT_CLASS_PATH=%EXT_CLASS_PATH%;d:\Sahi\extlib\db\mysql_connector_java_5.1.34_bin.jar;

2) Downloaded and installed the 64 bit ODBC drivers (AccessDatabaseEngine.exe)

3) Set the proxy and port in userdata.properties

Here is my code.


var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver(*.xlsx)};DBQ=d:\\Sahi\\userdata\\scripts\\My_works\\Login.xlsx;readOnly=false","","");
if(db != null)
{
var $rs = db.select("select * from [Sheet1$]");
}

I am encountering below ERROR.

--Stopped Playback: FAILURE--

Kindly help me please.

Lissy
  • 45
  • 1
  • 1
  • 6

1 Answers1

0

Lissy, I would suggest you not to use db APIs to work with the excel files. _getExcel and _readExcelFile should work perfectly for you.

  • Actually I tried that also. But again i am getting same error. Is any jars or anything to be installed to work this? please help – Lissy Nov 25 '14 at 11:18
  • Do you mean to say that you are not able to work with _getExcel and _readExcelFile as well?`var $rs = _readExcelFile("d:\\Sahi\\userdata\\scripts\\My_works\\Login.xlsx", "Sheet1");` should be working for you. – Palash Jain Nov 25 '14 at 11:37
  • Getting an ERROR ReferenceError: "_readExcelFile" is not defined. **Please help** – Lissy Nov 26 '14 at 04:03
  • Looks like you are a Sahi OS user (If so, then I wont be able to help you out much with it) or you upgraded Sahi Pro recently (If so, then do a fresh installation as this is looks like an upgradation issue), right? – Palash Jain Nov 26 '14 at 04:26