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.
False FAILURE when using _getDB() and $rs
Hi all
I'm getting a false FAILURE when using _getDB(). The data is retrieved and used correctly, but the test is marked as a FAILURE with the error message "TypeError: '0.BUYERID' is null or not an object No trace available"
The relevant bits of code are below:
Anyone else had this? Is there something else I should be doing to prevent the error?
Thanks.
I'm getting a false FAILURE when using _getDB(). The data is retrieved and used correctly, but the test is marked as a FAILURE with the error message "TypeError: '0.BUYERID' is null or not an object No trace available"
The relevant bits of code are below:
var db = _getDB("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin://50.1.0.157:1521/B2BTEST", "username", "password");
var $rs = [];
_set($rs, db.select("select ponumber, buyerid from po_header where buyerid = 'HW' and archived_status is null and status = 4 and id in (select fk_purchase_order_id from po_line_item having count(fk_purchase_order_id) > 1 group by fk_purchase_order_id) and rownum <= 10"));
...
_setValue(_textbox("buyid"), $rs[0]["BUYERID"]);
...
_click(_link("Amend[" + (_row(_table(1), $rs[0]["PONUMBER"]).rowIndex-1) + "]"));
As stated, the data values for the buyerid and ponumber are both being retrieved and used in the script correctly, but the test is still being marked as a FAILURE.Anyone else had this? Is there something else I should be doing to prevent the error?
Thanks.
Comments
When declaring the array to hold the result set, $rs = [];, if I also declare that $rs[0] will be an array, I do not get the error message and the test passes correctly:
The problem with this workaround is that it would need to be done for every row returned by the select query. In this instance, I've changed my query to only return the first row (using rownum = 1 in the where clause).
Obviously this approach would not work where a select query will return a result set of variable size.
So, any better solutions would be very much appreciated for future use.
Thanks.
Donna