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.

referring function defined in external js file in sahi script file

sumana.gargisumana.gargi Members
edited November -1 in Sahi - Open Source
Hi,

I am referring to a js function defined in external file and assgining to a variable.
I have added that file in inject_top.txt present in config folder.

When i run the script i am getting undefined error.

Please let me know can i include a js file in the _include command.

Comments

  • facilosfacilos Members
    edited October 2012
    Hello,

    just use the include.

    example:

    _include ("..\tmp\md5.js");

    The. Js contains a function called fmd5

    example:

    fMD5 function (SINP) {
    .
    .
    source code
    .
    .
      }
      return hex (a) + hex (b) + hex (c) + hex (d);
    }

    function calls from sahi
    $valor=fMD5($valor);

    good luck
Sign In or Register to comment.