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.

Script error

lepierrotlepierrot Members
edited November -1 in Sahi - Open Source
Hi,

I ran some scripts this morning and everything went well. After few modifications, I've relaunched the same script and then it returns me an error in a pop up :

Script error : http://192.168.198.217:8000/_s_/spr/concat.js:2799

Impossible to go further.
I've tried with others scripts and it works perfectly, so it seems to be this script that fails .. but I don't know what is wrong in it ... :(
I've reinstalled java but nothing new.

Help, because I'm running out of time !

Regards,

lepierrot

Comments

  • lepierrotlepierrot Members
    edited July 2008
    I've got some news :
    function pg_verify_port(){
        var $j;
        var $tmp="";;
        var $i;
        $check = 1;
        //_wait(2*$delay);
        _click(_link("GSM Ports"));
        _wait(2*$delay);
        for( var $current_pg = 0 ; $current_pg < $nbpg ; $current_pg++ ){
            _click(_radio("filtertype[2]"));
            _wait(1000);
            if(_condition($check==1)){
                _click(_checkbox("CB7"));
                _wait(1000);
            }
            $check = 0;
            _setSelected(_select("M7"), $pg[$current_pg][0][0]);
            _wait($delay);
            _click(_byId("label1"));
            _wait(2*$delay);
            for( var $current_gtw = 1 ; $current_gtw <= $pg[$current_pg][0][1] ; $current_gtw++ ){
                _debug($pg[$current_pg][$current_gtw][1]);
                _debug($pg[$current_pg][$current_gtw][2]);
                for( $i=0; $i<$pg[$current_pg][$current_gtw][2];$i++){
                    $j=3;
                    $tmp = $pg[$current_pg][$current_gtw][1].indexOf("1",$i);
                    if(_condition($tmp != "-1")){
                        while(_condition(_getText(_cell(_table(33),$j,2)) != $pg[$current_pg][$current_gtw][0]+" ("+$tmp+")")){
                        //
                        $j++;
                        }
                        _assertContainsText("sim missing",_cell(_table(33),$j,1));
                        $j=3;
                    }
                    $i=$tmp;
                }
                $i=0;
            }
            _click(_spandiv("FILTER"));
            _wait(2*$delay);
            
            
        }
        
    }
    
    The problem appears when I add the line $i=$tmp;
    When I don't, there are no issues...
    It's very strange because this morning it was working well ...
  • Hi,

    Try assigning the value of $temp to $i using _set(). It seems to have to do something with the page dependent variables. Try making a function that will return the required value and then assign it to $i.

    Regards,
    Pankaj.
  • Thank you very much it works perfectly now :)
  • Welcome :)
Sign In or Register to comment.