This is a Browser Action API.
_set is used to fetch the value of a page dependent variable (something that is part of the browser page) and store it in a Sahi variable. You would need this to access Javascript attributes not already exposed by Sahi’s APIs.
_set( $variableName, value );
The parameters are:
If we wish to get the href of a link,
var $href;
_set($href, _link("my link").href); // store
// you may do other actions or navigate to other pages
_assertEqual("http://sahi.co.in", $href); //use
Note that there is no Sahi API to retrieve the href property directly. For retrieving text using _getText, _set is not required.
var $text = _getText(_link("linkId"));
Another example with a browser function:
<browser>
function getRowLength(){
return _table("t1").rows.length
}
</browser>
var $count=0;
_set($count, getRowLength());
_alert($count);
Also look at Sahi Scripting Basics – 2