Forum Discussion
HKosova
11 years agoSmartBear Alumni (Retired)
Because 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.
Related Content
- 6 years ago
- 9 years ago
Recent Discussions
- 48 minutes ago
- 2 days ago