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 launch any program exe using sahi _execute( ) command?

aspatel80aspatel80 Members
edited November -1 in Sahi - Open Source
Hello team,

I have written the code to launch the edit plus using the _execute() command. But it is not launching the Editplus exe.

_execute("C:\\Program Files\\EditPlus 3\\editplus.exe');

I want to run the any exe using SAHi is there any way?

Ashvin

Comments

  • narayannarayan Administrators
    Do you see any errors on the Sahi console?
  • narayannarayan Administrators
    Ashvin,

    Put the command in a batch file and invoke the batch file from _execute.

    Eg.

    OpenEditPlus.bat
    with content
    "C:\\Program Files\\EditPlus 3\\editplus.exe"

    (with the quotes)


    _execute("D:\\Path\\OpenEditPlus.bat");
    

    Or you can also do
    java.lang.Runtime.getRuntime().exec("D:\\Path\\OpenEditPlus.bat");
    
  • Hi Narayan,

    I have created the bat file and written the command "C:\\Program Files\\EditPlus 3\\editplus.exe" including the quotes and it works fine.

    So to invoke any executable file Do I have to created batch file? Is there any command provided by the SAHI to execute the executable file directly?

    Thanks for your answer.

    Ashvin
  • narayannarayan Administrators
    Ashvin,

    I need to explore why the executable does not work directly. Will get back to you on that. Hope using a batch file works for the time being.

    Regards,
    Narayan
Sign In or Register to comment.