Forum Discussion

rlagrouw's avatar
rlagrouw
New Contributor
9 years ago
Solved

aqFileSystem.CreateFolder returns true but didn't create folder

First of all, I'm using TestComplete 11.20.1491.7, I'm on Windows 7 Business 64 bit SP1 and I'm scripting with python.   When using environment variables in your path, aqFileSystem.CreateFolder ret...
  • HKosova's avatar
    9 years ago

    Hi rlagrouw,

     

    aqFileSystem.CreateFolder does not support environment variables in paths. You need to use the path with all environment variables expanded:

    import os
    
    def Test():
        path = os.path.expandvars('%temp%\\MyFolder')
        aqFileSystem.CreateFolder(path) 
  • HKosova's avatar
    HKosova
    9 years ago

    rlagrouw wrote:

     

    I'm calling my function with a project variable (a string of course) as argument, like this:

    function(Project.Variables.myLocation)

    The project variable contains %TEMP%\myFolder\

     

    Doesn't work:

    def function(path):
       path = os.path.expandvars(path)

    Throws error "Invalid number of parameters".


    rlagrouw, can you try 11.3? I tried to repro the error but it works fine for me.

    11.3 includes some Python fixes and maybe a fix for this thing too.