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.

how to deal with jsObject return by DBClient#select

beesmanbeesman Members
edited August 2010 in Sahi - Open Source
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
Debug: {result: [["CODE"],["10022"]]}
Debug: 10022

Comments

  • beesmanbeesman Members
    edited August 2010
    I also tried

    _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
  • narayannarayan Administrators
    Hi Beesman,

    Just use:

    return $c["result"][1];
Sign In or Register to comment.