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.

bug

beesmanbeesman Members
edited November -1 in Sahi - Open Source
<table >
    <tr class="list_line_odd">
        <td><a>ddddddd     </a></td>
    </tr>
    <tr class="list_line_even">
        <td><a>sdfsdf</a></td> 
    </tr>
    <tr class="list_line_odd">
        <td><a>ddddddd     </a></td>
    </tr>
    <tr class="list_line_even">
        <td><a>sdfsdf</a></td> 
    </tr>
    <tr class="list_line_odd">
        <td><a>ddddddd    </a> </td>
    </tr>
    <tr class="list_line_even">
        <td><a>sdfsdf</a></td> 
    </tr>
</table>

Comments

  • beesmanbeesman Members
    edited August 2010
    test.sahi
       _debug(getDummyLink());
    
    <browser>
    function getDummyLink(){
        var $dummyLink;
        var $row;
        var $rowIndex;
        var $isOdd = true;
        for(var $n=0; true; $n++){
            if($isOdd){
                $rowIndex = "list_line_odd[" +  ($n/2) + "]";
            }else{
                $rowIndex = "list_line_even[" +  ($n%2-1) + "]";
            }
            $row = _row($rowIndex);
            if($isOdd){
                _debug("oddRowIndex:" + $rowIndex);
                _debug("oddRow:" + $row);
                $dummyLink =_link(0,_in($row)); // if there script is executed the evenRow will be undefined
    
                _debug($dummyLink);
            }else{
                _debug("evenRowIndex:" + $rowIndex);
                _debug("evenRow:" + $row);
                $dummyLink =_link(0,_in(_row("list_line_even[" +  ($n%2-1) + "]")));
            }
            $isOdd = (!$isOdd);
        }
        return $dummyLink;
    }
    </browser>
    
    

    console
    Debug: oddRowIndex:list_line_odd[0]
    Debug: oddRow:[object]
    Debug: evenRowIndex:list_line_even[0]
    Debug: evenRow:undefined
    
  • test.sahi
       _debug(getDummyLink());
    
    <browser>
    function getDummyLink(){
        var $dummyLink;
        var $row;
        var $rowIndex;
        var $isOdd = true;
        for(var $n=0; true; $n++){
            if($isOdd){
                $rowIndex = "list_line_odd[" +  ($n/2) + "]";
            }else{
                $rowIndex = "list_line_even[" +  ($n%2-1) + "]";
            }
            $row = _row($rowIndex);
            if($isOdd){
                _debug("oddRowIndex:" + $rowIndex);
                _debug("oddRow:" + $row);
              //  $dummyLink =_link(0,_in($row)); // if there script is executed the evenRow will be undefined
    
                _debug($dummyLink);
            }else{
                _debug("evenRowIndex:" + $rowIndex);
                _debug("evenRow:" + $row);
                $dummyLink =_link(0,_in(_row("list_line_even[" +  ($n%2-1) + "]")));
            }
            $isOdd = (!$isOdd);
        }
        return $dummyLink;
    }
    </browser>
    
    

    console
    Debug: oddRowIndex:list_line_odd[0]
    Debug: oddRow:[object]
    Debug: evenRowIndex:list_line_even[0]
    Debug: evenRow:[object]
    
Sign In or Register to comment.