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 to accept user inputs and run Sahi scripts

vineet.arora3vineet.arora3 Members
edited November -1 in Sahi - Open Source
Hi,

I want to pass some parameters to a function in Sahi script. These parameters can be string or integer.
Is there any way user can enter these in some dialog or some popup which emerges before running the script?

Thanks

Comments

  • narayannarayan Administrators
    Hi Vineet,
    // -- Add this to your script: Start --
    <browser>
    function promptForUserInput(){
        _sahi_temp_promptValue = _sahi._prompt("Enter a name");
    }
    </browser>
    
    function getUserInput(){
        var $value = null; 
        _call(promptForUserInput());
        _set($value, _sahi_temp_promptValue);
        return $value;
    }
    // -- Add this to your script: End --
    
    
    // Get the user input in your script
    var $userInput = getUserInput();
    _alert($userInput);
    

    Regards,
    Narayan
  • Thanks Narayan!
This discussion has been closed.