18 January 2026:


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 on setting global

globalwormingglobalworming Moderators
edited July 2014 in Sahi - Open Source
In this testscript, the logName function is not saved in the global:
function $anObject($name) {
  var $this=this;
  $this.name=$name
}

$anObject.prototype.logName = function(){
  $this=this;
  _log($this.name);
}

var $instance = new $anObject("instance of anObject");

//works
$instance.logName();

_setGlobal("instance", $instance);

var $globalInstance = _getGlobal("instance");

//does not work
$globalInstance.logName();

Is there an easy workaround for this issue?

Regards
Wormi
Sign In or Register to comment.