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 deal with jsObject return by DBClient#select
net.sf.sahi.plugin.DBClient.select(String, String, String, String, String)
function getcode($name){
var $c = the value return by DBClient#select;
_debug($c);
_debug(_eval('('+ $c +')')["result"][1]);
return _eval('('+ $c +')')["result"][1]; TypeError:Cannot read property "1" from undefined
}
console
function getcode($name){
var $c = the value return by DBClient#select;
_debug($c);
_debug(_eval('('+ $c +')')["result"][1]);
return _eval('('+ $c +')')["result"][1]; TypeError:Cannot read property "1" from undefined
}
console
Debug: {result: [["CODE"],["10022"]]}
Debug: 10022
Comments
_set($bb, _eval('('+ $c +')')["result"][1]);
TypeError:Cannot read property "1" from undefined
var $bb;
$bb = _eval('('+ $c +')')["result"][1];
TypeError:Cannot read property "1" from undefined
Just use:
return $c["result"][1];