18 January 2026:


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.

Getting data from excel files problem

tomorrowtomorrow Members
edited November -1 in Sahi - Open Source
Hi, I have problem with this script.
_include("../commons/common.sah");


var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", 
        "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\Finantix\\ebu\\sahiTests\\Sahi Tests\\scripts\\teller\\cashWithdrawal.xls;readOnly=false", 
        "", 
        "");

var $rs = [];
$rs[0] = [];
$rs = db.select("select * from [cashWithdrawal$]");
loginALLSIMO();
enterEnglish();
selectBillClinton();
cashWithdrawal($rs[0]["Transaction Id"],$rs[0]["Withdrawal Amount"],$rs[0]["Statistical Code"], $rs[0]["Description"]);
_click(_button("Ok"));
logout();

The problem ocures on select command. In log I get:
JSERROR
SyntaxError: syntax error at 9.11.2010 9:51:28

The Sahi console shows this exception
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not fou
nd and no default driver specified
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
        at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
        at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:3
23)
        at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at net.sf.sahi.plugin.DBClient.getResult(DBClient.java:96)
        at net.sf.sahi.plugin.DBClient.select(DBClient.java:79)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:24
7)
        at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)

        at org.mozilla.javascript.gen.c5._c56(<cmd>:462)
        at org.mozilla.javascript.gen.c5.call(<cmd>)
        at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)

        at org.mozilla.javascript.gen.c6._c0(<cmd>:72)
        at org.mozilla.javascript.gen.c6.call(<cmd>)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
98)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:306
5)
        at org.mozilla.javascript.gen.c6.call(<cmd>)
        at org.mozilla.javascript.gen.c6.exec(<cmd>)
        at org.mozilla.javascript.Context.evaluateString(Context.java:1104)
        at net.sf.sahi.rhino.RhinoScriptRunner.run(RhinoScriptRunner.java:93)
        at java.lang.Thread.run(Thread.java:619)

The data is on sheet cashWithdrawal and the path to the xls file is ok. Can you please help me with this?

Comments

This discussion has been closed.