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.
using if
Hi
In the documentation there is a warning : _assertNotNull / _assertNull .....
DO NOT USE THIS IN AN IF CONDITION as it does not return any value, and throws an exception if the object is null.
But If I [Test-->] this API Function I get the value true (assertNotNull(spandiv("somespandiv")), true in grey box below) --> how can I get this value,
I want to give my testscript more flexibility with if , in my case
if ( the element not there )
{do this }
else { do that }
if ( _assertNull (_spandiv("somespandiv"))==true)
.......
doesn't work
How can I do this assertion with Sahi functions ???
regards escape
In the documentation there is a warning : _assertNotNull / _assertNull .....
DO NOT USE THIS IN AN IF CONDITION as it does not return any value, and throws an exception if the object is null.
But If I [Test-->] this API Function I get the value true (assertNotNull(spandiv("somespandiv")), true in grey box below) --> how can I get this value,
I want to give my testscript more flexibility with if , in my case
if ( the element not there )
{do this }
else { do that }
if ( _assertNull (_spandiv("somespandiv"))==true)
.......
doesn't work
How can I do this assertion with Sahi functions ???
regards escape
Comments
I have found a solution, but for later releases it would be nice if the assert Functions return some values ......
Solution:
if ( _containsHTML(_byId("FOOTER"), "ERROR-sth went wrong")==false)
{ do it }
// if there is no error do it .... : D