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 create folder in local machine

sivasiva Members
edited November -1 in Sahi - Open Source
Dear All,

Is it possible to create a folder in local machine ?

i am not able to create folder with java script code using Sahi

showing error
ReferenceError: "ActiveXObject" is not defined.


Used Code to create folder

var $oActivex, $newFolder;
$oActivex = new ActiveXObject("Scripting.FileSystemObject");
$newFolder = $oActivex.CreateFolder ("D:\\ART\\");


kindly provide solutions to this problem

Thanks in advance to all


Thanks & Regards,
Siva

Comments

  • SumitraSumitra Members
    Hi Siva,

    You can use the following code to create a folder:
    var $file = new java.io.File("D:/folder1").mkdir();
    

    Regards
    Sumitra
  • sivasiva Members
    edited June 2011
    Dear Sumitra,

    its working. Thank you very much

    Regards,
    Siva
This discussion has been closed.