Contributions
Re: unexpected result from aqFolderInfo.Rename
I've come across some other problems with file/folder functions. I've been using aqFileSystem.GetFolderInfo to check whether a folder path (string) corresponds to an actual folder or not. I use something like: Set folder_obj = aqFileSystem.GetFolderInfo(folder_path) if folder_obj Is Not Nothing Then Log.Message("Folder name: " + folder_obj.name) else Log.Error("Not a valid folder") end if If folder_path is set to something like "c:\temp\file.txt" I was expecting this to trigger the error, but it runs fine and returns "file.txt" as the folder name. Is this expected behaviour? How else can I check that a folder path corresponds to a valid folder? thanks, Howard1.3KViews0likes0CommentsRe: unexpected result from aqFolderInfo.Rename
Thanks for the feedback.Do you have any further info on progress in tracking down or solving this issue? I'm currently using the Utilities.RenameFile as suggested, but this doesn't seem to work reliably. For example, when trying to rename "C:\dirA" to "C:\dirB", it sometimes fails - even when I confirm (before doing the rename) that "C:\dirA" exists and "C:\dirB" does NOT exist. Are there other reasons it could fail?Currently it works on some test runs, but fails a few times in others, with identical starting conditions. Howard1.3KViews0likes0Commentsunexpected result from aqFolderInfo.Rename
I'm trying to use theaqFolderInfo.Rename function to rename folders on the local disk, but I'm getting some unexpected results. What I'm trying to do is simple: rename an existing folder c:\dirA as c:\dirAA. I'm using a script like: Set OrigFolder = aqFileSystem.GetFolderInfo(OrigDir) if OrigFolder.Rename(NewDir) Then Log.Message("Directory " + OrigDir + " renamed as " + NewDir) else Log.Message("Failed to rename " + OrigDir + " as " + NewDir) end if but with OrigDir set to "C:\dirA" and NewDir set to "C:\dirAA" (and starting with a directory C:\dirA containing only some files) I end up with c:\dirAA\dirA (containing the same files). I just want to simply rename the directory - what's going wrong? I've tried using the functions for the trailing slash, but these either have no effect or cause the rename to fail (e.g. withOrigDir set to "C:\dirA\" and NewDir set to "C:\dirAA\"). Thanks for any help. (using TestComplete 7.51 on Vista 64) Howard11KViews0likes5Comments