Forum Discussion

msalvador's avatar
msalvador
Frequent Contributor
5 years ago

Test Execute, unable to open the file

Hi guys, I try to run test execute using the icon and option run. But after a bite, I have the following error :"unable to open the file". File is present in the folder and is not read only. Any ...
  • Wamboo's avatar
    Wamboo
    5 years ago

    hmmm

    If You want to work with Project Script files You need to use an absolute path.

    You can get path to You to project with this method: aqFileSystem.GetCurrentFolder();

     

    let pathToFile = aqFileSystem.GetCurrentFolder();
    let writeToFile = aqFile.WriteToTextFile(
      pathToFile + "\\script\\" + fileName + ".js",
      str,
      aqFile.ctUTF8, true
    );