Micro Focus QTP (UFT) Forums
Creating a folder from within a reusable action. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Creating a folder from within a reusable action. (/Thread-Creating-a-folder-from-within-a-reusable-action)



Creating a folder from within a reusable action. - sd3 - 06-04-2013

Hi.

I have the following problem: I have an action that creates a folder in windows, using this line:

Code:
Window("vol0cifs").WinObject("ShellView").WinMenu("ContextMenu").Select "New;Folder"

It works fine when i run this action.
But when i'm calling to this action from the main body of the test, i'm getting the following error:

Object not visible
Line (26):
Code:
"Window("vol0cifs").WinObject("ShellView").WinMenu("ContextMenu").Select "New;Folder"".

Anyone has any idea how to solve this?


RE: Creating a folder from within a reusable action. - frebuffi - 06-17-2013

try this:

Code:
CreateFolderDemo()

Function CreateFolderDemo
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.CreateFolder("c:\New Folder")  ' here put the path and name
   CreateFolderDemo = f.Path
End Function



RE: Creating a folder from within a reusable action. - learnQtptips - 06-18-2013

What I understand is you are trying to create a folder from a application context menu.
And it runs fine when you execute the Action alone, but when you integrate it it fails and says object not found.

If I am true, then try to insert Synchorization time and then activate the app again, because when the app is moving from one action to other it looses the focus and needs few miliseconds to perform the next

Let me know if it works