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.
textbox is not able to retain the value given in the script.
Hi,
i am automating a flow in which textbox will take value given in the excel sheet.But the textbox is not able to accept that value and displaying null.
Waiting fr your reply
Thanks.
i am automating a flow in which textbox will take value given in the excel sheet.But the textbox is not able to accept that value and displaying null.
Waiting fr your reply
Thanks.
Comments
The same Issue am too facing; data is taken from an excel sheet and needs to be filled in the corresponding text boxes. But it's showing 'null'.
It's not an excel formatting issue.
Vinay
Looks like the value is not being read correctly from the excel sheet. Try to do just an _alert() to alert the text, and check if it is null.
If you are unable to pinpoint the issue, please post the script here, and we will have a look at it.
Regards,
Narayan
When i was doing Datadriven test by using Excel, same problem i faced when didn't pass value to parameter in excel sheet. So i did like this:
function set($textBoxID, $setValue){
if ($setValue == "null"){
$setValue = "";
}
_setValue(_textbox($textBoxID), $setValue);
}
After writing above function, now i am able to pass without values from the excel.
if didn't pass any value to the parameter then it treats as "null". When pass this parameter to the text box then it displays in the text box like "null" so you can use above function to avoid this problem.
Regards,
Tulasi
//-- If 'null' in Excel cells
function EMPTY_IF_Null($s){ return ($s == "null" || $s == null) ? "" : $s; }
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\MYSHEET.xls;readOnly=false", "", "");
//--
var $rs = db.select("select * from [Donnees$]");
var $X_NameIntermed = EMPTY_IF_Null($rs[04]["COL_B"]);
var $X_Date1 = EMPTY_IF_Null($rs[02]["COL_B"]);
var $X_EMail = EMPTY_IF_Null($rs[15]["COL_B"]);
and so on ...
Regards,
Do you think it will help you if we add something like:
db.returnBlankIfNull(true/false), so that you can call it before your select and not worry about checking for null?
Regards,
Narayan
I think the issue of application taking null values on doing data driven testing (from excel file) is because of the format mismatch. As I have made some modifications in the excel format (changed the 'Number' format to 'Text'), it's working fine for me. (eg: 12 is read as 12.0 in some cases in excel (format issue) and the application is expecting the value '12' , not '12.0'). In this scenario, the excel value and the application value doesn't match and conflict occurs, so it pass 'null' value.
Please try this once so that we can avoid the null occurence issue.
Regards,
Vinay
Conflict will show up as an assertion exception, not as a null value.
Regards,
Narayan