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.
_setGlobal/_getGlobal with _getText
Need extra eyes to validate why the following does not work.
It is a syntax error of _setGlobal with _getText?
tried the following with no success:
/*
_setGlobal("Dinner", _getText(_div("Menu For Tonight")));
if ( (_getGlobal("Dinner")) == "Chicken" ) {
orderMore();
} else {
leaveNow();
}
*/
result above always proceeds to leaveNow()
It is a syntax error of _setGlobal with _getText?
tried the following with no success:
/*
_setGlobal("Dinner", _getText(_div("Menu For Tonight")));
if ( (_getGlobal("Dinner")) == "Chicken" ) {
orderMore();
} else {
leaveNow();
}
*/
result above always proceeds to leaveNow()
Comments
_getGlobal has to be used in a particular way to make it work. In your case, you would need
_setGlobal and _getGlobal are deprecated. You need not use it in this case. You could do the following:
or
or
Option 1 is the preferred way.
Regards,
Narayan
But I cant use any of the options #1,#2,#3 given above.
My global var is only available from the portal.
So the getGlobal is called from a different window.