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.

could anyone explain the Multidimensional array

supusupu Members
edited November -1 in Sahi - Open Source
I want to capture all values in a table using 2 dimensional Array.

Comments

  • u have to use csv file to do capture the two dimentinal array
  • hi
    var $table=_table("Yourtable");
    var $array = [];
    // we need 2 loops, one over the lines, one over the colums
    //loop over rows
    for($i; i<$table.rows.length; $i++){
      $array[$i]=[];
      //loop over cells
      var $cells=_collect("_cell", "/./", _in($table.rows[$i]));
      for ($j; $j<$cells.length; $j++){
        //populate array
        _set($array[$i][$j], _getText($cells[$j]));
      } 
    }
    

    code may have some errors, just wrote it down like it could work

    Regards
    Wormi
  • Thank you Very much Wormi. You have resolved my issue. Thanks a lot.
    This helps me a lot.
    Please keep answering my question, i will be really grateful to you.
This discussion has been closed.