12-16-2009, 03:58 PM
hi all ,
i have an application in which i have upload files functionality. i automated it and it works well until windows is not locked.But if windows is locked and scripts run, QTP can not upload files and throws an error "object not found..."
not only upload dialog box but also for other dialog boxes QTP gets struck.
i goggled for the solution and i got following code snippets ,just to close a dialog box when windows is locked:
this really helped me a lot But i got struck once again when it was a time to 'choose a file'/'type a file name' in "CHOOSE FILE TO UPLOAD" dialog box.
could any one explore his/her ideas on this issue?
i have an application in which i have upload files functionality. i automated it and it works well until windows is not locked.But if windows is locked and scripts run, QTP can not upload files and throws an error "object not found..."
not only upload dialog box but also for other dialog boxes QTP gets struck.
i goggled for the solution and i got following code snippets ,just to close a dialog box when windows is locked:
Code:
Public Const WM_COMMAND=273
Extern.Declare micLong, "PostMessage", "user32.dll", "PostMessageA", micHwnd, micLong, micLong, micLong
windowTitle = "message from browser " 'change it for different dialog box
buttonCode = 1 ' 1- OK, 2 Cancel in this dialog. It is "window id" property of the Button that you need to click - use Object Spy
Hwnd = Window("regexpwndtitle:="&windowTitle).GetRoProperty("hwnd")
lResult = extern.PostMessage(Hwnd, WM_COMMAND, buttonCode, 0)
this really helped me a lot But i got struck once again when it was a time to 'choose a file'/'type a file name' in "CHOOSE FILE TO UPLOAD" dialog box.
could any one explore his/her ideas on this issue?