Forum Discussion
HKosova
Alumni
12 years agoBecause your Python script doesn't explicitly specify the file folder, it creates the file in the current working folder, which in case of TestComplete is the project folder (where the .mds file is).
To create a file in a specific folder, you can do any of these:
1) Use the full file path in your Python script.
2) Use the aqFileSystem.SetCurrentFolder method to set the current working folder:
3) Specify the working folder in the command line:
Note: If you use Windows Vista+ and create the file in C:\, you need to run TestComplete as an Administrator.
To create a file in a specific folder, you can do any of these:
1) Use the full file path in your Python script.
2) Use the aqFileSystem.SetCurrentFolder method to set the current working folder:
aqFileSystem.SetCurrentFolder("C:\\");
Sys.OleObject("WScript.Shell").Run("C:\\Python27\\python.exe C:\\test.py");
3) Specify the working folder in the command line:
Sys.OleObject("WScript.Shell").Run("cmd /c cd C:\\ && C:\\Python27\\python.exe C:\\test.py");
Note: If you use Windows Vista+ and create the file in C:\, you need to run TestComplete as an Administrator.