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.

how do i associate javascript file to sahi script

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

I am new to SAHI tool, and i am at begining level.

i have prepared one function as below.

var a='034';
var b='035';
var c= parseInt(a)+parseInt(b);
alert(c);

just i want to execute the above 4 lines of code in sahi and if i prepare a function for the same, how can i associate to sahi.


please help me any one.

Thanking you inadvance..

Regards
Raja

Comments

  • Hi rajathummala,

    You can use like this:

    function values($a,$b){
    var $a;
    var $b;
    var $c= parseInt($a) + parseInt($b);
    _alert($c);
    }
    values('034','035')

    Also, have a look at: http://sahi.co.in/w/sahi-scripting-basics

    Regards
    Sumitra
  • Hi Sumitra,

    Thanks for your inputs and prompt response.. I am really very happy for your support.

    I have one more issue while running batch runner. i am getting 502 code error if i run testsuite file through command line. i thought that it is configuration issue. please give your inputs to get it done..


    Please reply..

    Thanking you in advance..

    Regards
    Raja
  • Hi Raja,

    Could you please post how you are running the suite file?

    Also, check if you are getting any error on Sahi console? If so then please post it here.

    Check if you are getting this error on other browsers as well?

    Regards
    Sumitra
  • Hi sumitra,

    I am using the below procedure to run suite file Throught command prompt;
    sahi/userdata/bin>testrunner.bat scripts/mysuite.suite firefox
    sahi/userdata/bin>testrunner.bat scripts/mysuite.suite ie

    when i run above script getting below error in command prompt.

    Server returned HTTP response code: 502 for URL

    Regards
    Raja
  • Hi Raja,

    The usage is wrong.You havent mentioned the URL.

    It should be:

    testrunner.bat demo/demo.suite http://sahi.co.in/demo/ firefox

    Also, have a look at : http://sahi.co.in/w/Running+multiple+tests+in+batch+mode

    Regards
    Sumitra
  • Hi Sumitra,

    I have used like the below. i had mentioned url as well. eventhough i am getting the same error.
    sahi/userdata/bin>testrunner.bat scripts/mysuite.suite url firefox

    Please reply...
    Thaking you in advance..
    Regards
    Raja
  • Hi Raja,

    Could you please check if the external proxy is set?

    Also, have a look at : http://sahi.co.in/w/configuring-an-external-proxy

    Let me know if this solves your issue.

    Regards
    Sumitra
  • Hi Sumitra,

    I would like to inform you that i have configured external proxy for http and https as well. but ext.http.proxy.auth.enable=false for both proxies.

    one more issue i am facing is i am able to run _dataDrive(myhcllogin,$content) on firefox multiple times based on the data provided. but in IE its working for firsttime, second time browser not opening for second time. please help me out from this issue..:)

    Thanks a lot for your wonderful support.....


    Regards

    Raja
  • Hi Raja,

    You need to set ext.http.proxy.auth.enable=true for both http and https site.

    Have a look at :http://sahi.co.in/w/configuring-an-external-proxy

    Also, for your second issue could you please point us to a URL?Where exactly you are facing issue?

    Regards
    Sumitra
  • Hi Sumitra,

    I have configured external proxy for both http and https even though its not working..

    Please help me out to resolve this issue..


    Regards
    Raja
Sign In or Register to comment.