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.
[Bug] function call in _assert() message and linebreak
globalworming
Moderators
Hi
i just discovered some misbehavior
function someFunction($string){
return $string;
}
_assertNotExists("something", "Here i want" + someFunction("this string"));
this works well when testing in the record tab of the sahi controller, but when I playback this piece of code, it says :
"ReferenceError: someFunction is not defined"
Additionally, when the message in the assert gets to long to fit my editor, I add a linebreak
_assertNotExists("something", "Here i want" +
"a long string to be diplayed);
This also only works in the testfield of the record tab, but will on playback say: missing ";"
I think that testfield and playback should behave equally, or am I doing something wrong?
Regards
Wormi
i just discovered some misbehavior
function someFunction($string){
return $string;
}
_assertNotExists("something", "Here i want" + someFunction("this string"));
this works well when testing in the record tab of the sahi controller, but when I playback this piece of code, it says :
"ReferenceError: someFunction is not defined"
Additionally, when the message in the assert gets to long to fit my editor, I add a linebreak
_assertNotExists("something", "Here i want" +
"a long string to be diplayed);
This also only works in the testfield of the record tab, but will on playback say: missing ";"
I think that testfield and playback should behave equally, or am I doing something wrong?
Regards
Wormi
Comments
1) You need to do
Have a look at the parsed script (from the Controller) to see why this is needed.
2) The parser of Sahi is not very sophisticated; so statements with actions APIs should be in a single line.
You could break it down like this:
Regards,
Narayan
I rarely look at the parsed script, kinda confusing
Thanks for your advice.
Regards Wormi