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.
Problem with customer function
Hi
I'm testing a web application, to aviode repetition I'm trying to use functions:
function checkMessage($htmlobject, $text)
{
_assertNotNull($htmlobject);
_assertEqual($text, _getText($htmlobject));
_assertContainsText($text,$htmlobject);
}
this functions looks good to me, but with the following call "checkMessage("<objectname>", "<text>"); " I'm getting this error:
_assertEqual("sometext", _getText("_cell(_table(8), 0, 0)")); Assertion Failed. Expected:[sometext] Actual:[undefined]
_assertContainsText("sometext","_cell(_table(8), 0, 0)"); TypeError: 'undefined' is Null
I think in case of _getText, there are problems with " " . it should be _getText(_cell(_table(8), 0, 0)) . Is there a workaround or a better solution?
thanks for help
best regards
escape
I'm testing a web application, to aviode repetition I'm trying to use functions:
function checkMessage($htmlobject, $text)
{
_assertNotNull($htmlobject);
_assertEqual($text, _getText($htmlobject));
_assertContainsText($text,$htmlobject);
}
this functions looks good to me, but with the following call "checkMessage("<objectname>", "<text>"); " I'm getting this error:
_assertEqual("sometext", _getText("_cell(_table(8), 0, 0)")); Assertion Failed. Expected:[sometext] Actual:[undefined]
_assertContainsText("sometext","_cell(_table(8), 0, 0)"); TypeError: 'undefined' is Null
I think in case of _getText, there are problems with " " . it should be _getText(_cell(_table(8), 0, 0)) . Is there a workaround or a better solution?
thanks for help
best regards
escape
Comments
Could you show how $htmlobject is declared and how checkMessage is being called?
yes you're right - it is string, because I try to identify the object by name, I'm told to use name instead of id or DOM-Position *o*
call for checkMessage:
checkMassege("_cell(_table(8), 0, 0)","verify_this_text")
So the function _assertNotNull needs an object, is there a function to built this _assertNotNull( < _getobjectbyname("objectname")> )
try this: