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 DOM object in CSV file instead of its value while writing

AnkitAnkit Members
edited November -1 in Sahi - Open Source
Hi,

I am trying to store a array in csv file,But in the CSV file the value is getting stored as
_sahi._textbox(\dAnnlPrm\").value, _sahi._textbox(\comPropNbr\").value
format instead of the actual value.

Script:-

var $FirstPremiumAmount =_textbox("dAnnlPrm").value;
var $ProposalNo = _textbox("comPropNbr").value;
var $result = new Array();
$result[0] = [$FirstPremiumAmount, $ProposalNo];
_writeCSVFile($result, "c:/sahi/userdata/scripts/NewBusiness/Result.csv", true, ",");

Please help.

Thanks in advance.

Comments

  • If the problem is the DOM object not giving you the values, you shall store in the variables with _set($var, _textbox().textContent) (or .value I'm not sure^^)
  • narayannarayan Administrators
    For fetching values, use

    var $FirstPremiumAmount = _getValue(_textbox("dAnnlPrm"));
    var $ProposalNo = _getValue(_textbox("comPropNbr"));
  • Thanks wormi :-)
Sign In or Register to comment.