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.
Declared variable becomes null
Hi,
I have a problem when declaring variables.
If sahi is fresh started, the variables are taken corectly, but after running the same script again, the variables are asserted to null and I can't use them after. Why?
This is a part of the code:
var $deep1 = _getText(_cell(_table("chart-table chart-table-content",_in(_div("deep_links"))),0,0));
var $deepnr1 = _getText(_cell(_table("chart-table chart-table-content",_in(_div("deep_links"))),0,1));
_log($deep1);
_log($deepnr1);
Logs:
null [14078 ms] [10:40:28.066]
null [144 ms] [10:40:28.219]
I have a problem when declaring variables.
If sahi is fresh started, the variables are taken corectly, but after running the same script again, the variables are asserted to null and I can't use them after. Why?
This is a part of the code:
var $deep1 = _getText(_cell(_table("chart-table chart-table-content",_in(_div("deep_links"))),0,0));
var $deepnr1 = _getText(_cell(_table("chart-table chart-table-content",_in(_div("deep_links"))),0,1));
_log($deep1);
_log($deepnr1);
Logs:
null [14078 ms] [10:40:28.066]
null [144 ms] [10:40:28.219]
Best Answer
-
Hi loana,
Can you provide the webpage where you're running the mentioned script?
Regards.
Answers
I managed to code so the script if it takes null then to realocate that var so it has the proper value and not null.
Thx.
I will close this discussion then.
Regards.