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.

Sahi - Latest developments

narayannarayan Administrators
edited November -1 in Sahi - Open Source
I know I have not been active on the forums for sometime. Thanks a ton to StringyLow, tinchie8, lepierrot, pankaj.nith and others for keeping this forum active, and replying to posts.

Meanwhile I have been working on a version of Sahi which attacks one of the basic problems with Sahi.
Scopes of variables, scheduler and normal functions and the the way steps are queued and executed and the way their integrity needs to be maintained across page loads.

The problem had been that the scripts (after parsing) were executed on the browser itself, and when a page unloads, the state of the script's execution needed to be persisted on the proxy and then resurrected when the next page loaded. While this allowed the ease of using javascript for scripting, when scripts became bigger, the browsers and the proxy had to do a lot more persisting and resurrecting.

As the logical next step, I wanted to move this script execution to the proxy. I now use Rhino, an excellent javascript engine, to execute the scripts on the proxy. Only steps that need to be executed on the browser are sent to the browser. Javascript can still be used for sahi scripting. Even though the script still is parsed, it is much simpler to understand script execution than it was before. Rhino also comes with a debugger which can prove useful to Sahi script debugging.

The version is slated to be released soon. I am looking for volunteers to test and give me feedback about the new version. If you have existing scripts, the scripts may need to be modified a little to make it work with the new version.
If you are interested, please post back or email me at narayan at sahi.co.in.


Thanks and regards,
Narayan

Comments

  • Great news!
  • I'm back! This is really great news!
  • I'm excited!
  • Hi,

    As you have mentioned that we may need to modify our old sahi scripts to make them work can you please throw some light what changes we may need to make. I tried running my old script on the new build but it is throwing some reference error while calling a function that i have in my script. It worked fine in the earlier build.

    Regards,
    Pankaj.
  • narayannarayan Administrators
    Sorry. Have a look at Scripting Changes in Sahi V2. Thanks for pointing out.
  • pankaj.nithpankaj.nith Members
    edited September 2008
    Great..thats the exact problem that occured. Will revert back with updates/issues.. :)
    That resolved my function related problem. BUt am facing one more issue::
    There is an iframe that should appear within the blurred parent window. However the same when run through new version, the iframe covers the entire window with no blurred parent window visible. After that the same iframe/page keeps on reloading in endless loop.
    We faced the same issue a month back but that was machine dependent. It occured only on a couple of machines.

    Any insights?

    Regards,
    Pankaj.
  • narayannarayan Administrators
    Not sure what the reason is. The Sahi code on the browser has not changed much. Is it possible to post the code which opens the iframe? Or email me the details. I will have a look and get back to you.
  • Hi,
    Below is the chunk of code (With names changed) that is used to find a particular link within the iframe and click it. Can't use the iframe name to identify elements as the iframe name is dynamic and is decided on runtime.
    function getcount($list){
            return $list.options.length;
        }
    var $len;
    _set($len, getcount(_select("pageselect")));
    for (var $i = 1; $i <= $len; $i++){
        if (_condition(_link("someName")!=null)){
            _click(_link("someName"));
            break;
        }
        else{    
            _setSelected(_select("pageselect"), $i + " of " + $len);
            _wait(5000);
        }
    }
    
    Regards,
    Pankaj.
  • narayannarayan Administrators
    Pankaj,

    Just _link("someName") should return you the link after having gone through the iframes automatically. If not, it is a bug.

    _set($len, getcount(_select("pageselect"))); is going to executed on the browser.
    So getcount will need to be sent to the browser.

    Use
    <browser>
    function getcount($list){
            return $list.options.length;
    }
    </browser>
    
    or
    _set($len, _select("pageselect").options.length);
    
  • pankaj.nithpankaj.nith Members
    edited September 2008
    Have tried both. But the issue remains same. The iframe instead of covering some middle region of the window is covering the entire window. This iframe is invoked on clicking a link on the parent page. Without proxy it appears fine.
    I am sorry if my explaination is not quite understandable.
  • Also that the waiting for socket issue comes while iterating through the pages in the iframe. so am not able to test that also as the script is not moving past this stage.
This discussion has been closed.